From 81dd01cda8ad2e7e416a1ea0b032312a9cc9b786 Mon Sep 17 00:00:00 2001 From: nobody Date: Fri, 12 Oct 2001 03:06:34 +0000 Subject: [PATCH] This commit was manufactured by cvs2svn to create tag 'd2x-0_1_0'. --- 2d/Makefile.am | 25 +- 2d/Makefile.in | 313 -- 2d/bitblt.c | 3 + 2d/bitmap.c | 3 + 2d/box.c | 4 +- 2d/canvas.c | 3 + 2d/circle.c | 7 +- 2d/diff | 354 -- 2d/disc.c | 3 + 2d/font.c | 11 + 2d/gpixel.c | 3 + 2d/ibitblt.c | 2 + 2d/line.c | 3 + 2d/palette.c | 3 + 2d/pcx.c | 3 + 2d/pixel.c | 3 + 2d/poly.c | 3 + 2d/rect.c | 3 + 2d/rle.c | 7 +- 2d/scale.c | 13 +- 2d/scalec.c | 4 + 2d/tmerge.c | 6 +- 3d/Makefile.am | 4 + 3d/Makefile.in | 303 -- 3d/clipper.c | 4 + 3d/draw.c | 7 +- 3d/globvars.c | 14 +- 3d/instance.c | 14 +- 3d/interp.c | 16 +- 3d/matrix.c | 13 +- 3d/points.c | 15 +- 3d/rod.c | 14 +- 3d/setup.c | 13 +- AUTHORS | 3 +- COPYING | 4 + ChangeLog | 776 ++- INSTALL | 5 +- Makefile.am | 20 +- Makefile.in | 363 -- NEWS | 28 + README | 26 +- acconfig.h | 53 + aclocal.m4 | 192 + arch/Makefile.am | 49 +- arch/Makefile.in | 314 -- arch/dos/Makefile.am | 23 +- arch/dos/Makefile.in | 307 -- arch/dos/allg_snd/Makefile.am | 5 + arch/dos/allg_snd/sound/Makefile.am | 6 + arch/dos/allg_snd/sound/drv/Makefile.am | 3 + arch/dos/bak/Makefile.am | 2 + arch/dos/cdrom.c | 77 - arch/dos/comm/Makefile.am | 5 + arch/dos/comm/include/Makefile.am | 3 + arch/dos/digi.c | 810 ---- arch/dos/dosgr.c | 724 --- arch/dos/dpmi.c | 398 -- arch/dos/findfile.c | 95 - arch/dos/include/Makefile.am | 2 + arch/dos/include/joy.h | 188 - arch/dos/init.c | 369 -- arch/dos/ipx.c | 908 ---- arch/dos/joy2.asm | 471 -- arch/dos/joyc.c | 799 ---- arch/dos/joydefs.c | 673 --- arch/dos/key.c | 709 --- arch/dos/mm_snd/Makefile.am | 5 + arch/dos/mm_snd/include/Makefile.am | 2 + arch/dos/modex.asm | 829 ---- arch/dos/mouse.c | 655 --- arch/dos/sgrep.out | 3 - arch/dos/timer.asm | 496 -- arch/dos/tweak.inc | 258 - arch/dos/vesa.c | 140 - arch/dos/vgaregs.inc | 62 - arch/dos_dpmi.c | 17 +- arch/dos_findfile.c | 22 +- arch/dos_init.c | 38 +- arch/dos_ipx.c | 167 +- arch/dos_modex.asm | 10 +- arch/dos_timer.asm | 12 + arch/dos_tweak.inc | 7 +- arch/dos_vesa.c | 18 +- arch/dos_vgaregs.inc | 7 +- arch/include/Makefile.am | 1 + arch/include/event.h | 27 + {input/linux => arch}/include/joy.h | 117 +- arch/{dos => }/include/key.h | 80 +- arch/{dos => }/include/mouse.h | 77 +- arch/linux/Makefile.am | 12 +- arch/linux/Makefile.in | 304 -- arch/linux/findfile.c | 58 - arch/linux/include/Makefile.am | 3 + arch/linux/init.c | 51 - arch/linux/ipx_bsd.c | 230 - arch/linux/ipx_lin.c | 218 - arch/linux/ipx_udp.c | 593 --- arch/linux/linuxnet.c | 368 -- arch/linux/stHqFIq1 | Bin 86016 -> 0 bytes arch/linux/svgalib/include/event.h | 9 - arch/linux/svgalib/include/key.h | 271 -- arch/linux/svgalib/include/mouse.h | 127 - arch/linux/svgalib/init.c | 9 - arch/linux_findfile.c | 17 +- arch/linux_init.c | 24 +- arch/linux_ipx_bsd.c | 20 +- arch/linux_ipx_lin.c | 18 +- arch/linux_ipx_udp.c | 19 +- arch/linux_net.c | 24 +- arch/ogl/include/loadgl.h | 1935 -------- arch/ogl/include/ogl_init.h | 160 - arch/sdl/Makefile.am | 4 - arch/sdl/Makefile.in | 299 -- arch/sdl/init.c | 29 - arch/sdl/timer.c | 13 - arch/sdl_init.c | 23 +- arch/sdl_timer.c | 17 +- arch/win32/Makefile.am | 8 + arch/win32/d3dframe/Makefile.am | 5 + arch/win32/include/Makefile.am | 3 + .../win95/findfile.c => arch/win32_findfile.c | 8 +- autogen.sh | 7 +- cfile/Makefile.am | 3 + cfile/Makefile.in | 299 -- cfile/cfile.c | 3 + conf.h.in | 48 +- configure | 2360 --------- configure.in | 238 +- copying | 21 - cvshowto.txt | 74 + cygconf | 2 + iff/Makefile.am | 2 + iff/Makefile.in | 299 -- iff/archive/Makefile.am | 2 + iff/iff.c | 15 +- include/3d.h | 9 +- include/Makefile.am | 10 + include/args.h | 9 +- include/console.h | 4 +- include/d_delay.h | 9 +- include/d_io.h | 2 + include/error.h | 14 +- include/gr.h | 20 +- include/loadgl.h | 2 +- include/modex.h | 1 + include/mono.h | 1 + include/ogl_init.h | 18 +- include/pstypes.h | 31 +- include/strutil.h | 21 +- include/u_mem.h | 7 +- input/Makefile.am | 50 +- input/Makefile.in | 313 -- input/dos_joyc.c | 160 +- input/dos_joydefs.c | 270 +- input/dos_key.c | 140 +- input/dos_mouse.c | 69 +- input/ggi/Makefile.am | 5 - input/ggi/Makefile.in | 300 -- input/ggi/event.c | 127 - input/ggi/include/event.h | 14 - input/ggi/include/key.h | 273 -- input/ggi/include/mouse.h | 127 - input/ggi/init.c | 11 - input/ggi/key.c | 495 -- input/ggi/mouse.c | 158 - input/ggi_event.c | 22 +- input/ggi_init.c | 14 + input/ggi_key.c | 40 +- input/ggi_mouse.c | 21 +- input/linux/Makefile.am | 5 +- input/linux/Makefile.in | 299 -- input/linux/include/Makefile.am | 2 + input/linux/include/joystick.h | 266 -- input/linux/include/linux_joystick.h | 43 + input/linux/joydefs.c | 237 - input/linux/joystick.c | 376 -- input/linux_joydefs.c | 19 +- input/linux_joystick.c | 45 +- input/sdl/Makefile.am | 4 - input/sdl/Makefile.in | 299 -- input/sdl/event.c | 54 - input/sdl/include/event.h | 9 - input/sdl/include/key.h | 271 -- input/sdl/include/mouse.h | 127 - input/sdl/key.c | 616 --- input/sdl/mouse.c | 234 - input/sdl_event.c | 16 +- input/sdl_joy.c | 109 + input/sdl_joydefs.c | 31 + input/sdl_key.c | 19 +- input/sdl_mouse.c | 27 +- .../svgalib/event.c => input/svgalib_event.c | 15 +- input/svgalib_init.c | 24 + .../svgalib/key.c => input/svgalib_key.c | 38 +- .../svgalib/mouse.c => input/svgalib_mouse.c | 64 +- libtool | 4240 ----------------- license.txt | 45 + ltconfig | 3022 ------------ ltmain.sh | 3975 ---------------- main/Makefile.am | 55 +- main/Makefile.in | 348 -- main/ai.c | 7 +- main/ai.h | 2 - main/ai2.c | 6 +- main/aipath.c | 3 + main/automap.c | 4 +- main/bm.c | 9 +- main/bmread.c | 7 +- main/cmd.c | 3 + main/cntrlcen.c | 7 +- main/collide.c | 10 +- main/config.c | 14 +- main/console.c | 5 +- main/controls.c | 6 +- main/credits.c | 9 +- main/crypt.c | 7 +- main/dumpmine.c | 6 +- main/editor/Makefile.am | 2 + main/effects.c | 6 +- main/endlevel.c | 8 +- main/escort.c | 4 +- main/fireball.c | 4 +- main/fuelcen.c | 6 +- main/fuelcen.h | 2 + main/fvi.c | 4 +- main/game.c | 40 +- main/gamecntl.c | 25 +- main/gamefont.c | 6 +- main/gamemine.c | 7 +- main/gamepal.c | 6 +- main/gamerend.c | 14 +- main/gamesave.c | 14 +- main/gameseg.c | 8 +- main/gameseq.c | 16 +- main/gauges.c | 10 +- main/hostage.c | 7 +- main/hud.c | 4 +- main/inferno.c | 214 +- main/kconfig.c | 111 +- main/kludge.c | 12 +- main/kmatrix.c | 22 +- main/laser.c | 14 +- main/lighting.c | 8 +- main/menu.c | 25 +- main/mglobal.c | 7 +- main/mission.c | 7 +- main/morph.c | 7 +- main/multi.c | 14 +- main/netmisc.c | 7 +- main/network.c | 91 +- main/network.h | 9 +- main/newdemo.c | 12 +- main/newmenu.c | 30 +- main/object.c | 70 +- main/object.h | 6 +- main/old/Makefile.am | 5 + main/paging.c | 7 +- main/physics.c | 10 +- main/piggy.c | 20 +- main/playsave.c | 3 +- main/polyobj.c | 29 +- main/powerup.c | 3 +- main/render.c | 13 +- main/robot.c | 3 +- main/slew.c | 11 +- main/songs.c | 11 +- main/state.c | 16 +- main/switch.c | 11 +- main/test.txt | 1 - main/texmerge.c | 2 + main/text.c | 9 +- main/titles.c | 6 +- main/vclip.c | 7 +- main/vers_id.h | 2 +- main/wall.c | 9 +- main/weapon.c | 7 +- maths/Makefile.am | 18 +- maths/Makefile.in | 307 -- maths/fixc.c | 19 +- maths/rand.c | 3 + maths/tables.c | 10 +- maths/vecmat.c | 14 +- mem/Makefile.in | 299 -- mem/mem.c | 49 +- misc/Makefile.am | 3 + misc/Makefile.in | 307 -- misc/args.c | 20 +- misc/byteswap.c | 3 + misc/d_delay.c | 6 +- misc/d_glob.c | 8 +- misc/d_io.c | 4 + misc/error.c | 14 +- misc/hash.c | 7 +- misc/strio.c | 4 + misc/strutil.c | 9 +- sound/Makefile.am | 13 +- sound/Makefile.in | 300 -- sound/dos_cdrom.c | 29 +- sound/dos_digi.c | 24 +- sound/sdl_cdrom.c | 20 +- sound/sdl_digi.c | 16 +- stamp-h.in | 0 texmap/Makefile.am | 25 +- texmap/Makefile.in | 309 -- texmap/ntmap.c | 21 +- texmap/scanline.c | 13 +- texmap/tmapflat.c | 15 +- tools/Makefile.am | 1 + tools/cvs2cl/Makefile.am | 2 + tools/cvs2cl/cvs2cl.pl | 1787 +++++++ unused/Makefile.am | 4 + unused/bios/Makefile.am | 10 + unused/lib/Makefile.am | 2 + unused/novga/Makefile.am | 3 + unused/pa_null/Makefile.am | 3 + unused/ui/Makefile.am | 6 + unused/vga/Makefile.am | 9 + unused/vga/new/Makefile.am | 2 + unused/win95/Makefile.am | 8 + video/Makefile.am | 30 +- video/Makefile.in | 300 -- video/dos_gr.c | 19 +- video/ggi_gr.c | 27 +- video/ogl.c | 396 +- video/ogl_glx.c | 17 +- video/ogl_gr.c | 29 +- video/ogl_sdl.c | 96 + video/ogl_wgl.c | 21 +- video/sdl_gr.c | 38 +- arch/linux/svgalib/gr.c => video/svgalib_gr.c | 22 +- 330 files changed, 6924 insertions(+), 37555 deletions(-) delete mode 100644 2d/Makefile.in delete mode 100644 2d/diff delete mode 100644 3d/Makefile.in delete mode 100644 Makefile.in create mode 100644 acconfig.h delete mode 100644 arch/Makefile.in delete mode 100644 arch/dos/Makefile.in create mode 100644 arch/dos/allg_snd/Makefile.am create mode 100644 arch/dos/allg_snd/sound/Makefile.am create mode 100644 arch/dos/allg_snd/sound/drv/Makefile.am create mode 100644 arch/dos/bak/Makefile.am delete mode 100644 arch/dos/cdrom.c create mode 100644 arch/dos/comm/Makefile.am create mode 100644 arch/dos/comm/include/Makefile.am delete mode 100644 arch/dos/digi.c delete mode 100644 arch/dos/dosgr.c delete mode 100644 arch/dos/dpmi.c delete mode 100644 arch/dos/findfile.c create mode 100644 arch/dos/include/Makefile.am delete mode 100644 arch/dos/include/joy.h delete mode 100644 arch/dos/init.c delete mode 100644 arch/dos/ipx.c delete mode 100644 arch/dos/joy2.asm delete mode 100644 arch/dos/joyc.c delete mode 100644 arch/dos/joydefs.c delete mode 100644 arch/dos/key.c create mode 100644 arch/dos/mm_snd/Makefile.am create mode 100644 arch/dos/mm_snd/include/Makefile.am delete mode 100644 arch/dos/modex.asm delete mode 100644 arch/dos/mouse.c delete mode 100644 arch/dos/sgrep.out delete mode 100644 arch/dos/timer.asm delete mode 100644 arch/dos/tweak.inc delete mode 100644 arch/dos/vesa.c delete mode 100644 arch/dos/vgaregs.inc create mode 100644 arch/include/Makefile.am create mode 100644 arch/include/event.h rename {input/linux => arch}/include/joy.h (71%) rename arch/{dos => }/include/key.h (75%) rename arch/{dos => }/include/mouse.h (59%) delete mode 100644 arch/linux/Makefile.in delete mode 100644 arch/linux/findfile.c create mode 100644 arch/linux/include/Makefile.am delete mode 100644 arch/linux/init.c delete mode 100644 arch/linux/ipx_bsd.c delete mode 100644 arch/linux/ipx_lin.c delete mode 100644 arch/linux/ipx_udp.c delete mode 100644 arch/linux/linuxnet.c delete mode 100644 arch/linux/stHqFIq1 delete mode 100644 arch/linux/svgalib/include/event.h delete mode 100644 arch/linux/svgalib/include/key.h delete mode 100644 arch/linux/svgalib/include/mouse.h delete mode 100644 arch/linux/svgalib/init.c delete mode 100644 arch/ogl/include/loadgl.h delete mode 100644 arch/ogl/include/ogl_init.h delete mode 100644 arch/sdl/Makefile.am delete mode 100644 arch/sdl/Makefile.in delete mode 100644 arch/sdl/init.c delete mode 100644 arch/sdl/timer.c create mode 100644 arch/win32/Makefile.am create mode 100644 arch/win32/d3dframe/Makefile.am create mode 100644 arch/win32/include/Makefile.am rename unused/win95/findfile.c => arch/win32_findfile.c (93%) delete mode 100644 cfile/Makefile.in delete mode 100644 configure delete mode 100644 copying create mode 100644 cvshowto.txt create mode 100644 cygconf delete mode 100644 iff/Makefile.in create mode 100644 iff/archive/Makefile.am create mode 100644 include/Makefile.am delete mode 100644 input/Makefile.in delete mode 100644 input/ggi/Makefile.am delete mode 100644 input/ggi/Makefile.in delete mode 100644 input/ggi/event.c delete mode 100644 input/ggi/include/event.h delete mode 100644 input/ggi/include/key.h delete mode 100644 input/ggi/include/mouse.h delete mode 100644 input/ggi/init.c delete mode 100644 input/ggi/key.c delete mode 100644 input/ggi/mouse.c delete mode 100644 input/linux/Makefile.in create mode 100644 input/linux/include/Makefile.am delete mode 100644 input/linux/include/joystick.h create mode 100644 input/linux/include/linux_joystick.h delete mode 100644 input/linux/joydefs.c delete mode 100644 input/linux/joystick.c delete mode 100644 input/sdl/Makefile.am delete mode 100644 input/sdl/Makefile.in delete mode 100644 input/sdl/event.c delete mode 100644 input/sdl/include/event.h delete mode 100644 input/sdl/include/key.h delete mode 100644 input/sdl/include/mouse.h delete mode 100644 input/sdl/key.c delete mode 100644 input/sdl/mouse.c create mode 100644 input/sdl_joy.c create mode 100644 input/sdl_joydefs.c rename arch/linux/svgalib/event.c => input/svgalib_event.c (64%) create mode 100644 input/svgalib_init.c rename arch/linux/svgalib/key.c => input/svgalib_key.c (89%) rename arch/linux/svgalib/mouse.c => input/svgalib_mouse.c (75%) delete mode 100644 libtool create mode 100644 license.txt delete mode 100644 ltconfig delete mode 100644 ltmain.sh delete mode 100644 main/Makefile.in create mode 100644 main/editor/Makefile.am create mode 100644 main/old/Makefile.am delete mode 100644 main/test.txt delete mode 100644 maths/Makefile.in delete mode 100644 mem/Makefile.in delete mode 100644 misc/Makefile.in delete mode 100644 sound/Makefile.in delete mode 100644 stamp-h.in delete mode 100644 texmap/Makefile.in create mode 100644 tools/Makefile.am create mode 100644 tools/cvs2cl/Makefile.am create mode 100644 tools/cvs2cl/cvs2cl.pl create mode 100644 unused/Makefile.am create mode 100644 unused/bios/Makefile.am create mode 100644 unused/lib/Makefile.am create mode 100644 unused/novga/Makefile.am create mode 100644 unused/pa_null/Makefile.am create mode 100644 unused/ui/Makefile.am create mode 100644 unused/vga/Makefile.am create mode 100644 unused/vga/new/Makefile.am create mode 100644 unused/win95/Makefile.am delete mode 100644 video/Makefile.in create mode 100644 video/ogl_sdl.c rename arch/linux/svgalib/gr.c => video/svgalib_gr.c (94%) diff --git a/2d/Makefile.am b/2d/Makefile.am index 3629b8fa..ddbb31ec 100644 --- a/2d/Makefile.am +++ b/2d/Makefile.am @@ -1,18 +1,27 @@ noinst_LIBRARIES = lib2d.a INCLUDES = -I $(top_srcdir)/includes +if USE_ASM +lib2d_a_SOURCES = \ +2dsline.c box.c disc.c ibitblt.c pcx.c rect.c scalec.c \ +bitblt.c canvas.c font.c line.c pixel.c rle.c \ +bitmap.c circle.c gpixel.c palette.c poly.c +else lib2d_a_SOURCES = \ 2dsline.c box.c disc.c ibitblt.c pcx.c rect.c scalec.c \ bitblt.c canvas.c font.c line.c pixel.c rle.c tmerge.c \ -bitmap.c circle.c gpixel.c palette.c poly.c +bitmap.c circle.c gpixel.c palette.c poly.c +endif -if USE_ASM - SUFFIXES = .asm - %.o: %.asm +SUFFIXES = .asm +%.o: %.asm $(NASM) $(NASMFLAGS) $< -o $@ - - lib2d_a_SOURCES += linear.asm tmerge_a.asm - lib2d_a_LIBADD += linear.o tmerge_a.o - 2dsline.c: linear.o tmerge_a.o + +if USE_ASM +lib2d_a_LIBADD += linear.o tmerge_a.o endif +EXTRA_DIST = \ +linear.asm scalea.asm tmerge_a.asm \ +bitmap.h clip.h linear.h scalea.h \ +scale.c diff --git a/2d/Makefile.in b/2d/Makefile.in deleted file mode 100644 index e3502c2a..00000000 --- a/2d/Makefile.in +++ /dev/null @@ -1,313 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# 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. - -# 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. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CFLAGS = @CFLAGS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NASM = @NASM@ -NASMFLAGS = @NASMFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -SDL_LIBS = @SDL_LIBS@ -VERSION = @VERSION@ - -noinst_LIBRARIES = lib2d.a -INCLUDES = -I $(top_srcdir)/includes - -lib2d_a_SOURCES = 2dsline.c box.c disc.c ibitblt.c pcx.c rect.c scalec.c bitblt.c canvas.c font.c line.c pixel.c rle.c tmerge.c bitmap.c circle.c gpixel.c palette.c poly.c - -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../conf.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I.. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -lib2d_a_LIBADD = -lib2d_a_OBJECTS = 2dsline.o box.o disc.o ibitblt.o pcx.o rect.o \ -scalec.o bitblt.o canvas.o font.o line.o pixel.o rle.o tmerge.o \ -bitmap.o circle.o gpixel.o palette.o poly.o -AR = ar -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -DEP_FILES = .deps/2dsline.P .deps/bitblt.P .deps/bitmap.P .deps/box.P \ -.deps/canvas.P .deps/circle.P .deps/disc.P .deps/font.P .deps/gpixel.P \ -.deps/ibitblt.P .deps/line.P .deps/palette.P .deps/pcx.P .deps/pixel.P \ -.deps/poly.P .deps/rect.P .deps/rle.P .deps/scalec.P .deps/tmerge.P -SOURCES = $(lib2d_a_SOURCES) -OBJECTS = $(lib2d_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu 2d/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -.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: - -lib2d.a: $(lib2d_a_OBJECTS) $(lib2d_a_DEPENDENCIES) - -rm -f lib2d.a - $(AR) cru lib2d.a $(lib2d_a_OBJECTS) $(lib2d_a_LIBADD) - $(RANLIB) lib2d.a - -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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - 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 = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = 2d - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu 2d/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - 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 - @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 -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -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-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-depend mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - 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-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags 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 \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -@USE_ASM_TRUE@ SUFFIXES = .asm -@USE_ASM_TRUE@ %.o: %.asm -@USE_ASM_TRUE@ $(NASM) $(NASMFLAGS) $< -o $@ - -@USE_ASM_TRUE@ lib2d_a_SOURCES += linear.asm tmerge_a.asm -@USE_ASM_TRUE@ lib2d_a_LIBADD += linear.o tmerge_a.o -@USE_ASM_TRUE@ 2dsline.c: linear.o tmerge_a.o - -# 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/2d/bitblt.c b/2d/bitblt.c index 3efdc777..98354231 100644 --- a/2d/bitblt.c +++ b/2d/bitblt.c @@ -11,7 +11,10 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H #include +#endif + #include #include "u_mem.h" #include "gr.h" diff --git a/2d/bitmap.c b/2d/bitmap.c index 740e4855..92ec8a63 100644 --- a/2d/bitmap.c +++ b/2d/bitmap.c @@ -11,7 +11,10 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H #include +#endif + #include #include diff --git a/2d/box.c b/2d/box.c index 019838a1..bb6f08b7 100644 --- a/2d/box.c +++ b/2d/box.c @@ -11,7 +11,10 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H #include +#endif + #include "u_mem.h" @@ -122,4 +125,3 @@ void gr_box(int left,int top,int right,int bot) else gr_ubox12( left, top, right, bot ); } - diff --git a/2d/canvas.c b/2d/canvas.c index 3956c371..0b7956c6 100644 --- a/2d/canvas.c +++ b/2d/canvas.c @@ -11,7 +11,10 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H #include +#endif + #include //#include #include diff --git a/2d/circle.c b/2d/circle.c index 4d25a70b..42b7ff23 100644 --- a/2d/circle.c +++ b/2d/circle.c @@ -11,11 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef RCS -static char rcsid[] = "$Id: circle.c,v 1.1.1.1 2001-01-19 03:29:57 bradleyb Exp $"; +static char rcsid[] = "$Id: circle.c,v 1.2 2001-01-31 15:17:47 bradleyb Exp $"; #endif -#include #include "u_mem.h" #include "gr.h" diff --git a/2d/diff b/2d/diff deleted file mode 100644 index 28b32c1c..00000000 --- a/2d/diff +++ /dev/null @@ -1,354 +0,0 @@ -13a14 -> #include -23c24 -< #include "mem.h" ---- -> #include "u_mem.h" -31a33 -> #include "bitmap.h" -133a136 -> -135a139,156 -> //hack to allow color codes to be embedded in strings -MPM -> //note we subtract one from color, since 255 is "transparent" so it'll never be used, and 0 would otherwise end the string. -> //function must already have orig_color var set (or they could be passed as args...) -> //perhaps some sort of recursive orig_color type thing would be better, but that would be way too much trouble for little gain -> int gr_message_color_level=1; -> #define CHECK_EMBEDDED_COLORS() if ((*text_ptr >= 0x01) && (*text_ptr <= 0x03)) { \ -> text_ptr++; \ -> if (*text_ptr){ \ -> if (gr_message_color_level >= *(text_ptr-1)) \ -> FG_COLOR = *text_ptr - 1; \ -> text_ptr++; \ -> } \ -> } \ -> else if ((*text_ptr >= 0x04) && (*text_ptr <= 0x06)){ \ -> if (gr_message_color_level >= *text_ptr - 3) \ -> FG_COLOR=orig_color; \ -> text_ptr++; \ -> } -359c380 -< ---- -> #ifdef __ENV_MSDOS__ -749a771 -> #endif -975a998 -> #ifndef OGL -1049a1073,1336 -> #else // OGL -> -> #include "../main/inferno.h" -> #include "ogl_init.h" -> #include "args.h" -> //font handling routines for OpenGL - Added 9/25/99 Matthew Mueller - they are here instead of in arch/ogl because they use all these defines -> -> int pow2ize(int x);//from ogl.c -> -> int get_font_total_width(grs_font * font){ -> if (font->ft_flags & FT_PROPORTIONAL){ -> int i,w=0,c=font->ft_minchar; -> for (i=0;c<=font->ft_maxchar;i++,c++){ -> if (font->ft_widths[i]<0) -> Error("heh?\n"); -> w+=font->ft_widths[i]; -> } -> return w; -> }else{ -> return font->ft_w*(font->ft_maxchar-font->ft_minchar+1); -> } -> } -> void ogl_font_choose_size(grs_font * font,int gap,int *rw,int *rh){ -> int nchars = font->ft_maxchar-font->ft_minchar+1; -> int r,x,y,nc=0,smallest=999999,smallr=-1,tries; -> int smallprop=10000; -> int h,w; -> for (h=32;h<=256;h*=2){ -> // h=pow2ize(font->ft_h*rows+gap*(rows-1)); -> if (font->ft_h>h)continue; -> r=(h/(font->ft_h+gap)); -> w=pow2ize((get_font_total_width(font)+(nchars-r)*gap)/r); -> tries=0; -> do { -> if (tries) -> w=pow2ize(w+1); -> if(tries>3){ -> mprintf((0,"failed to fit (%ix%i, %ic)\n",w,h,nc)); -> break; -> } -> nc=0; -> y=0; -> while(y+font->ft_h<=h){ -> x=0; -> while (x if (nc==nchars) -> break; -> if (font->ft_flags & FT_PROPORTIONAL){ -> if (x+font->ft_widths[nc]+gap>w)break; -> x+=font->ft_widths[nc++]+gap; -> }else{ -> if (x+font->ft_w+gap>w)break; -> x+=font->ft_w+gap; -> nc++; -> } -> } -> if (nc==nchars) -> break; -> y+=font->ft_h+gap; -> } -> -> tries++; -> }while(nc!=nchars); -> if (nc!=nchars) -> continue; -> mprintf((0,"fit: %ix%i %i tries\n",w,h,tries)); -> -> if (w*h==smallest){//this gives squarer sizes priority (ie, 128x128 would be better than 512*32) -> if (w>=h){ -> if (w/h smallprop=w/h; -> smallest++;//hack -> } -> }else{ -> if (h/w smallprop=h/w; -> smallest++;//hack -> } -> } -> } -> if (w*h smallr=1; -> smallest=w*h; -> *rw=w; -> *rh=h; -> } -> } -> if (smallr<=0) -> Error("couldn't fit font?\n"); -> mprintf((0,"using %ix%i\n",*rw,*rh)); -> printf("using %ix%i\n",*rw,*rh); -> -> } -> -> void ogl_init_font(grs_font * font){ -> int nchars = font->ft_maxchar-font->ft_minchar+1; -> int i,w,h,tw,th,x,y,curx=0,cury=0; -> char *fp; -> // char data[32*32*4]; -> char *data; -> int gap=0;//having a gap just wastes ram, since we don't filter text textures at all. -> // char s[2]; -> ogl_font_choose_size(font,gap,&tw,&th); -> data=malloc(tw*th); -> gr_init_bitmap(&font->ft_parent_bitmap,BM_LINEAR,0,0,tw,th,tw,data); -> -> font->ft_parent_bitmap.gltexture=ogl_get_free_texture(); -> -> font->ft_bitmaps=(grs_bitmap*)malloc( nchars * sizeof(grs_bitmap)); -> mprintf((0,"ogl_init_font %s, %s, nchars=%i, (%ix%i tex)\n",(font->ft_flags & FT_PROPORTIONAL)?"proportional":"fixedwidth",(font->ft_flags & FT_COLOR)?"color":"mono",nchars,tw,th)); -> // s[1]=0; -> h=font->ft_h; -> // sleep(5); -> -> for(i=0;i // s[0]=font->ft_minchar+i; -> // gr_get_string_size(s,&w,&h,&aw); -> if (font->ft_flags & FT_PROPORTIONAL) -> w=font->ft_widths[i]; -> else -> w=font->ft_w; -> // mprintf((0,"char %i(%ix%i): ",i,w,h)); -> if (w<1 || w>256){ -> mprintf((0,"grr\n"));continue; -> } -> if (curx+w+gap>tw){ -> cury+=h+gap; -> curx=0; -> } -> if (cury+h>th) -> Error("font doesn't really fit (%i/%i)?\n",i,nchars); -> if (font->ft_flags & FT_COLOR) { -> if (font->ft_flags & FT_PROPORTIONAL) -> fp = font->ft_chars[i]; -> else -> fp = font->ft_data + i * w*h; -> for (y=0;y for (x=0;x font->ft_parent_bitmap.bm_data[curx+x+(cury+y)*tw]=fp[x+y*w]; -> } -> -> // gr_init_bitmap(&font->ft_bitmaps[i],BM_LINEAR,0,0,w,h,w,font->); -> }else{ -> int BitMask,bits=0,white=gr_find_closest_color(63,63,63); -> // if (w*h>sizeof(data)) -> // Error("ogl_init_font: toobig\n"); -> if (font->ft_flags & FT_PROPORTIONAL) -> fp = font->ft_chars[i]; -> else -> fp = font->ft_data + i * BITS_TO_BYTES(w)*h; -> for (y=0;y BitMask=0; -> for (x=0; x< w; x++ ) -> { -> if (BitMask==0) { -> bits = *fp++; -> BitMask = 0x80; -> } -> -> if (bits & BitMask) -> font->ft_parent_bitmap.bm_data[curx+x+(cury+y)*tw]=white; -> else -> font->ft_parent_bitmap.bm_data[curx+x+(cury+y)*tw]=255; -> BitMask >>= 1; -> } -> } -> } -> gr_init_sub_bitmap(&font->ft_bitmaps[i],&font->ft_parent_bitmap,curx,cury,w,h); -> -> curx+=w+gap; -> } -> if (!(font->ft_flags & FT_COLOR)) { -> //use GL_INTENSITY instead of GL_RGB -> if (ogl_intensity4_ok){ -> font->ft_parent_bitmap.gltexture->internalformat=GL_INTENSITY4; -> font->ft_parent_bitmap.gltexture->format=GL_LUMINANCE; -> }else if (ogl_luminance4_alpha4_ok){ -> font->ft_parent_bitmap.gltexture->internalformat=GL_LUMINANCE4_ALPHA4; -> font->ft_parent_bitmap.gltexture->format=GL_LUMINANCE_ALPHA; -> }else if (ogl_rgba2_ok){ -> font->ft_parent_bitmap.gltexture->internalformat=GL_RGBA2; -> font->ft_parent_bitmap.gltexture->format=GL_RGBA; -> }else{ -> font->ft_parent_bitmap.gltexture->internalformat=ogl_rgba_format; -> font->ft_parent_bitmap.gltexture->format=GL_RGBA; -> } -> } -> ogl_loadbmtexture_m(&font->ft_parent_bitmap,0); -> } -> -> int ogl_internal_string(int x, int y, char *s ) -> { -> ubyte * text_ptr, * next_row, * text_ptr1; -> int width, spacing,letter; -> int xx,yy; -> int orig_color=FG_COLOR;//to allow easy reseting to default string color with colored strings -MPM -> -> next_row = s; -> -> yy = y; -> -> if (grd_curscreen->sc_canvas.cv_bitmap.bm_type != BM_OGL) -> Error("carp.\n"); -> while (next_row != NULL) -> { -> text_ptr1 = next_row; -> next_row = NULL; -> -> text_ptr = text_ptr1; -> -> xx = x; -> -> if (xx==0x8000) //centered -> xx = get_centered_x(text_ptr); -> -> while (*text_ptr) -> { -> if (*text_ptr == '\n' ) -> { -> next_row = &text_ptr[1]; -> yy += FHEIGHT; -> break; -> } -> -> letter = *text_ptr-FMINCHAR; -> -> get_char_width(text_ptr[0],text_ptr[1],&width,&spacing); -> -> if (!INFONT(letter) || *text_ptr<=0x06) { //not in font, draw as space -> CHECK_EMBEDDED_COLORS() else{ -> xx += spacing; -> text_ptr++; -> } -> continue; -> } -> -> // ogl_ubitblt(FONT->ft_bitmaps[letter].bm_w,FONT->ft_bitmaps[letter].bm_h,xx,yy,0,0,&FONT->ft_bitmaps[letter],NULL); -> // if (*text_ptr>='0' && *text_ptr<='9'){ -> printf("%p\n",&FONT->ft_bitmaps[letter]); -> if (FFLAGS&FT_COLOR) -> gr_ubitmapm(xx,yy,&FONT->ft_bitmaps[letter]); -> else{ -> if (grd_curcanv->cv_bitmap.bm_type==BM_OGL) -> ogl_ubitmapm_c(xx,yy,&FONT->ft_bitmaps[letter],FG_COLOR); -> else -> Error("ogl_internal_string: non-color string to non-ogl dest\n"); -> // gr_ubitmapm(xx,yy,&FONT->ft_bitmaps[letter]);//ignores color.. -> } -> //} -> -> xx += spacing; -> -> text_ptr++; -> } -> -> } -> return 0; -> } -> int gr_internal_color_string(int x, int y, char *s ){ -> return ogl_internal_string(x,y,s); -> } -> -> #endif // OGL -> -1118a1406 -> #ifdef __ENV_MSDOS__ -1123a1412 -> #endif -1248a1538,1539 -> #define swapshort(a) (a) -> #define swapint(a) (a) -1251a1543 -> old_grs_font *oldfont; -1284c1576,1578 -< font = (grs_font *) malloc(datasize); ---- -> oldfont = (old_grs_font *) malloc(datasize); -> font = (grs_font *) malloc(sizeof(grs_font)); -> font->oldfont = oldfont; -1288c1582,1590 -< cfread(font,1,datasize,fontfile); ---- -> cfread(oldfont,1,datasize,fontfile); -> font->ft_flags=swapshort(oldfont->ft_flags); -> font->ft_w=swapshort(oldfont->ft_w); -> font->ft_h=swapshort(oldfont->ft_h); -> font->ft_baseline=swapshort(oldfont->ft_baseline); -> font->ft_maxchar=oldfont->ft_maxchar; -> font->ft_minchar=oldfont->ft_minchar; -> font->ft_bytewidth=swapshort(oldfont->ft_bytewidth); -> -1307c1609 -< font->ft_widths = (short *) (((int) font->ft_widths) + ((ubyte *) font)); ---- -> font->ft_widths = (short *) (((int) oldfont->ft_widths) + ((ubyte *) oldfont)); -1311c1613 -< font->ft_widths[i] = SWAPSHORT(font->ft_widths[i]); ---- -> font->ft_widths[i] = swapshort(oldfont->ft_widths[i]); -1314c1616 -< font->ft_data = ((int) font->ft_data) + ((ubyte *) font); ---- -> font->ft_data = ((int) oldfont->ft_data) + ((ubyte *) oldfont); -1330c1632 -< font->ft_data = ((unsigned char *) font) + sizeof(*font); ---- -> font->ft_data = ((unsigned char *) oldfont) + sizeof(*oldfont); -1339c1641 -< font->ft_kerndata = ((int) font->ft_kerndata) + ((ubyte *) font); ---- -> font->ft_kerndata = swapint(((int) oldfont->ft_kerndata) + ((ubyte *) oldfont)); -1386a1689,1692 -> -> #ifdef OGL -> ogl_init_font(font); -> #endif diff --git a/2d/disc.c b/2d/disc.c index 9a280c01..a8582ad4 100644 --- a/2d/disc.c +++ b/2d/disc.c @@ -11,7 +11,10 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H #include +#endif + #include "u_mem.h" #include "gr.h" diff --git a/2d/font.c b/2d/font.c index d0bf3cf7..7ca67717 100644 --- a/2d/font.c +++ b/2d/font.c @@ -11,7 +11,10 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H #include +#endif + #include #include #include @@ -145,6 +148,8 @@ int gr_internal_string0(int x, int y, char *s ) unsigned int VideoOffset, VideoOffset1; + bits=0; + VideoOffset1 = y * ROWSIZE + x; next_row = s; @@ -257,6 +262,8 @@ int gr_internal_string0m(int x, int y, char *s ) unsigned int VideoOffset, VideoOffset1; + bits=0; + VideoOffset1 = y * ROWSIZE + x; next_row = s; @@ -1515,6 +1522,8 @@ int gr_internal_string_clipped(int x, int y, char *s ) int r, BitMask, i, bits, width, spacing, letter, underline; int x1 = x, last_x; + bits=0; + next_row = s; while (next_row != NULL ) @@ -1613,6 +1622,8 @@ int gr_internal_string_clipped_m(int x, int y, char *s ) int r, BitMask, i, bits, width, spacing, letter, underline; int x1 = x, last_x; + bits=0; + next_row = s; while (next_row != NULL ) diff --git a/2d/gpixel.c b/2d/gpixel.c index d1e0b686..d2389c81 100644 --- a/2d/gpixel.c +++ b/2d/gpixel.c @@ -11,7 +11,10 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H #include +#endif + #include "u_mem.h" #include "gr.h" diff --git a/2d/ibitblt.c b/2d/ibitblt.c index e858570d..3d7099a6 100644 --- a/2d/ibitblt.c +++ b/2d/ibitblt.c @@ -17,7 +17,9 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H #include +#endif #include #include "pstypes.h" diff --git a/2d/line.c b/2d/line.c index b9f34f63..5b0fd553 100644 --- a/2d/line.c +++ b/2d/line.c @@ -15,7 +15,10 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H #include +#endif + #include #include "u_mem.h" diff --git a/2d/palette.c b/2d/palette.c index be6f427a..bf9e7773 100644 --- a/2d/palette.c +++ b/2d/palette.c @@ -15,7 +15,10 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H #include +#endif + #include #include diff --git a/2d/pcx.c b/2d/pcx.c index d6dbc630..44fbf5de 100644 --- a/2d/pcx.c +++ b/2d/pcx.c @@ -16,7 +16,10 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H #include +#endif + #include #include #include diff --git a/2d/pixel.c b/2d/pixel.c index a0c9951b..6bb05bf0 100644 --- a/2d/pixel.c +++ b/2d/pixel.c @@ -16,7 +16,10 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H #include +#endif + #include "u_mem.h" #include "gr.h" diff --git a/2d/poly.c b/2d/poly.c index 62bd27b1..693fd782 100644 --- a/2d/poly.c +++ b/2d/poly.c @@ -16,7 +16,10 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H #include +#endif + #include "u_mem.h" #include "gr.h" #include "grdef.h" diff --git a/2d/rect.c b/2d/rect.c index 60576b7d..716f6a86 100644 --- a/2d/rect.c +++ b/2d/rect.c @@ -16,7 +16,10 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H #include +#endif + #include "u_mem.h" #include "gr.h" diff --git a/2d/rle.c b/2d/rle.c index 02a82dbf..26fee949 100644 --- a/2d/rle.c +++ b/2d/rle.c @@ -14,11 +14,14 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef RCS -static char rcsid[] = "$Id: rle.c,v 1.1.1.1 2001-01-19 03:29:57 bradleyb Exp $"; +static char rcsid[] = "$Id: rle.c,v 1.2 2001-01-31 15:17:48 bradleyb Exp $"; #endif -#include #include #include #include diff --git a/2d/scale.c b/2d/scale.c index 1cf5fde6..7864834a 100644 --- a/2d/scale.c +++ b/2d/scale.c @@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/2d/scale.c,v $ - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:29:57 $ + * $Date: 2001-01-31 15:17:48 $ * * Routines for scaling a bitmap. * * $Log: not supported by cvs2svn $ + * Revision 1.1.1.1 2001/01/19 03:29:57 bradleyb + * Import of d2x-0.0.8 + * * Revision 1.1.1.1 1999/06/14 21:57:36 donut * Import of d1x 1.37 source. * @@ -64,12 +67,14 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: scale.c,v 1.1.1.1 2001-01-19 03:29:57 bradleyb Exp $"; +static char rcsid[] = "$Id: scale.c,v 1.2 2001-01-31 15:17:48 bradleyb Exp $"; #endif -#include #include #include #include diff --git a/2d/scalec.c b/2d/scalec.c index c68f6a05..e31a7c74 100644 --- a/2d/scalec.c +++ b/2d/scalec.c @@ -10,7 +10,11 @@ CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ + +#ifdef HAVE_CONFIG_H #include +#endif + #include #include "gr.h" #include "grdef.h" diff --git a/2d/tmerge.c b/2d/tmerge.c index 2364379d..5d7362f6 100644 --- a/2d/tmerge.c +++ b/2d/tmerge.c @@ -1,8 +1,9 @@ // tmerge.c - C Texture merge routines for use with D1X // Ripped from ldescent by +#ifdef HAVE_CONFIG_H #include -#ifdef NO_ASM // If for some reason we have elected not to use assembler... +#endif #include "gr.h" @@ -56,6 +57,3 @@ void gr_merge_textures_3( ubyte * lower, ubyte * upper, ubyte * dest ) *dest++ = c; } } - - -#endif diff --git a/3d/Makefile.am b/3d/Makefile.am index c4bbfd7f..fcdb3ff5 100644 --- a/3d/Makefile.am +++ b/3d/Makefile.am @@ -4,3 +4,7 @@ INCLUDES = -I $(top_srcdir)/includes lib3d_a_SOURCES = \ clipper.c globvars.c interp.c points.c setup.c \ draw.c instance.c matrix.c rod.c + +EXTRA_DIST = \ +interp.asm \ +clipper.h globvars.h diff --git a/3d/Makefile.in b/3d/Makefile.in deleted file mode 100644 index 59d8ac7d..00000000 --- a/3d/Makefile.in +++ /dev/null @@ -1,303 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# 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. - -# 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. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CFLAGS = @CFLAGS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NASM = @NASM@ -NASMFLAGS = @NASMFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -SDL_LIBS = @SDL_LIBS@ -VERSION = @VERSION@ - -noinst_LIBRARIES = lib3d.a -INCLUDES = -I $(top_srcdir)/includes - -lib3d_a_SOURCES = clipper.c globvars.c interp.c points.c setup.c draw.c instance.c matrix.c rod.c - -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../conf.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I.. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -lib3d_a_LIBADD = -lib3d_a_OBJECTS = clipper.o globvars.o interp.o points.o setup.o draw.o \ -instance.o matrix.o rod.o -AR = ar -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -DEP_FILES = .deps/clipper.P .deps/draw.P .deps/globvars.P \ -.deps/instance.P .deps/interp.P .deps/matrix.P .deps/points.P \ -.deps/rod.P .deps/setup.P -SOURCES = $(lib3d_a_SOURCES) -OBJECTS = $(lib3d_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu 3d/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -.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: - -lib3d.a: $(lib3d_a_OBJECTS) $(lib3d_a_DEPENDENCIES) - -rm -f lib3d.a - $(AR) cru lib3d.a $(lib3d_a_OBJECTS) $(lib3d_a_LIBADD) - $(RANLIB) lib3d.a - -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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - 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 = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = 3d - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu 3d/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - 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 - @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 -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -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-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-depend mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - 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-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags 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 \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -# 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/3d/clipper.c b/3d/clipper.c index 9d1cdcdc..462d4bfd 100644 --- a/3d/clipper.c +++ b/3d/clipper.c @@ -10,7 +10,11 @@ CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ + +#ifdef HAVE_CONFIG_H #include +#endif + #include "fix.h" #include "vecmat.h" #include "gr.h" diff --git a/3d/draw.c b/3d/draw.c index 9ce9c058..a5ba9efa 100644 --- a/3d/draw.c +++ b/3d/draw.c @@ -16,11 +16,14 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef RCS -static char rcsid[] = "$Id: draw.c,v 1.1.1.1 2001-01-19 03:29:58 bradleyb Exp $"; +static char rcsid[] = "$Id: draw.c,v 1.2 2001-01-31 15:17:48 bradleyb Exp $"; #endif -#include #include "error.h" #include "fix.h" diff --git a/3d/globvars.c b/3d/globvars.c index b31aae71..d4e7c81d 100644 --- a/3d/globvars.c +++ b/3d/globvars.c @@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/3d/globvars.c,v $ - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:29:58 $ + * $Date: 2001-01-31 15:17:48 $ * * Global variables for 3d * * $Log: not supported by cvs2svn $ + * Revision 1.1.1.1 2001/01/19 03:29:58 bradleyb + * Import of d2x-0.0.8 + * * Revision 1.1.1.1 1999/06/14 21:57:45 donut * Import of d1x 1.37 source. * @@ -34,11 +37,14 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef RCS -static char rcsid[] = "$Id: globvars.c,v 1.1.1.1 2001-01-19 03:29:58 bradleyb Exp $"; +static char rcsid[] = "$Id: globvars.c,v 1.2 2001-01-31 15:17:48 bradleyb Exp $"; #endif -#include #include "fix.h" #include "vecmat.h" #include "gr.h" diff --git a/3d/instance.c b/3d/instance.c index 1e66feae..51cadfb1 100644 --- a/3d/instance.c +++ b/3d/instance.c @@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/3d/instance.c,v $ - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:29:58 $ + * $Date: 2001-01-31 15:17:48 $ * * Instancing routines * * $Log: not supported by cvs2svn $ + * Revision 1.1.1.1 2001/01/19 03:29:58 bradleyb + * Import of d2x-0.0.8 + * * Revision 1.1.1.1 1999/06/14 21:57:45 donut * Import of d1x 1.37 source. * @@ -34,11 +37,14 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef RCS -static char rcsid[] = "$Id: instance.c,v 1.1.1.1 2001-01-19 03:29:58 bradleyb Exp $"; +static char rcsid[] = "$Id: instance.c,v 1.2 2001-01-31 15:17:48 bradleyb Exp $"; #endif -#include #include #include "error.h" diff --git a/3d/interp.c b/3d/interp.c index 9f0899bd..8d269636 100644 --- a/3d/interp.c +++ b/3d/interp.c @@ -8,17 +8,20 @@ SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERV +COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/3d/interp.c,v $ - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:29:58 $ + * $Date: 2001-01-31 15:17:48 $ * * Polygon object interpreter * * $Log: not supported by cvs2svn $ + * Revision 1.1.1.1 2001/01/19 03:29:58 bradleyb + * Import of d2x-0.0.8 + * * Revision 1.1.1.1 1999/06/14 21:57:47 donut * Import of d1x 1.37 source. * @@ -40,11 +43,14 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERV * */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef RCS -static char rcsid[] = "$Id: interp.c,v 1.1.1.1 2001-01-19 03:29:58 bradleyb Exp $"; +static char rcsid[] = "$Id: interp.c,v 1.2 2001-01-31 15:17:48 bradleyb Exp $"; #endif -#include #include #include "fix.h" diff --git a/3d/matrix.c b/3d/matrix.c index e9301b5b..b7401536 100644 --- a/3d/matrix.c +++ b/3d/matrix.c @@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/3d/matrix.c,v $ - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:29:58 $ + * $Date: 2001-01-31 15:17:48 $ * * Matrix setup & manipulation routines * * $Log: not supported by cvs2svn $ + * Revision 1.1.1.1 2001/01/19 03:29:58 bradleyb + * Import of d2x-0.0.8 + * * Revision 1.1.1.1 1999/06/14 21:57:48 donut * Import of d1x 1.37 source. * @@ -31,12 +34,14 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: matrix.c,v 1.1.1.1 2001-01-19 03:29:58 bradleyb Exp $"; +static char rcsid[] = "$Id: matrix.c,v 1.2 2001-01-31 15:17:48 bradleyb Exp $"; #endif -#include #include "fix.h" #include "vecmat.h" #include "gr.h" diff --git a/3d/points.c b/3d/points.c index 65473707..f61d4d3b 100644 --- a/3d/points.c +++ b/3d/points.c @@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/3d/points.c,v $ - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:29:58 $ + * $Date: 2001-01-31 15:17:48 $ * * Routines for point definition, rotation, etc. * * $Log: not supported by cvs2svn $ + * Revision 1.1.1.1 2001/01/19 03:29:58 bradleyb + * Import of d2x-0.0.8 + * * Revision 1.1.1.1 1999/06/14 21:57:49 donut * Import of d1x 1.37 source. * @@ -37,12 +40,14 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ -#ifdef RCS -static char rcsid[] = "$Id: points.c,v 1.1.1.1 2001-01-19 03:29:58 bradleyb Exp $"; +#ifdef HAVE_CONFIG_H +#include #endif +#ifdef RCS +static char rcsid[] = "$Id: points.c,v 1.2 2001-01-31 15:17:48 bradleyb Exp $"; +#endif -#include #include "fix.h" #include "vecmat.h" #include "gr.h" diff --git a/3d/rod.c b/3d/rod.c index 9f5e9d8d..967452a6 100644 --- a/3d/rod.c +++ b/3d/rod.c @@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/3d/rod.c,v $ - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:29:58 $ + * $Date: 2001-01-31 15:17:48 $ * * Rod routines * * $Log: not supported by cvs2svn $ + * Revision 1.1.1.1 2001/01/19 03:29:58 bradleyb + * Import of d2x-0.0.8 + * * Revision 1.2 1999/09/21 04:05:55 donut * mostly complete OGL implementation (still needs bitmap handling (reticle), and door/fan textures are corrupt) * @@ -37,11 +40,14 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef RCS -static char rcsid[] = "$Id: rod.c,v 1.1.1.1 2001-01-19 03:29:58 bradleyb Exp $"; +static char rcsid[] = "$Id: rod.c,v 1.2 2001-01-31 15:17:48 bradleyb Exp $"; #endif -#include #include "fix.h" #include "vecmat.h" #include "gr.h" diff --git a/3d/setup.c b/3d/setup.c index 37ed8abc..d0ae5a2e 100644 --- a/3d/setup.c +++ b/3d/setup.c @@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/3d/setup.c,v $ - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:29:58 $ + * $Date: 2001-01-31 15:17:48 $ * * Setup for 3d library * * $Log: not supported by cvs2svn $ + * Revision 1.1.1.1 2001/01/19 03:29:58 bradleyb + * Import of d2x-0.0.8 + * * Revision 1.3 1999/10/07 02:27:14 donut * OGL includes to remove warnings * @@ -46,12 +49,14 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: setup.c,v 1.1.1.1 2001-01-19 03:29:58 bradleyb Exp $"; +static char rcsid[] = "$Id: setup.c,v 1.2 2001-01-31 15:17:48 bradleyb Exp $"; #endif -#include #include #include "error.h" diff --git a/AUTHORS b/AUTHORS index 5743b611..c8a5e543 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,2 +1,3 @@ Parallax Software Corporation (original authors) -Peter Hawkins +Peter Hawkins (d2x port to linux and dos) +Bradley Bell (maintainer as of 2001.01.20 diff --git a/COPYING b/COPYING index b23848af..cbceffdb 100644 --- a/COPYING +++ b/COPYING @@ -19,3 +19,7 @@ MUST be open source. By using this source, you are agreeing to this term, in the interest of the descent and descent programming communities. The only exception is if the writer of the original source gives explicit permission for the code to be used otherwise. + +Portions of d2x code are taken from the d1x project. This code is +covered by the d1x license, in the file license.txt + diff --git a/ChangeLog b/ChangeLog index ac2fd95a..fa68d88f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,22 +1,754 @@ ---- Version 0.0.8 --- -Added -nocdrom option, fixed cdrom code. -Made various error messages more helpful. -Big code cleanup - removed lots and lots of warnings. Still plenty left, but most are gone. -Kludge to allow the game to work with v1.0 datafiles. -Workaround for odd gcc bug (possible). -Fixed mission and demo loading. -Fixed nonetwork build. -Removed libtool dependancy. (Thanks to Falk Hueffner for pointing this out) ---- Version 0.0.7 --- -Added beginnings of console. (main/console.c main/cmd.c) -Added -debug command line option to show debug information. -Fixed -nosound option. -Changed malloc, calloc, free -> d_malloc, d_calloc and d_free to prevent ugly clashes between the real and the wrapped system calls. Added d_strdup -Removed dos linefeeds from the source files -Fixed palette problems with flat shaded polygons. - -Issues currently under investigation: -* Weird crash reported by Robert Linden - as yet unreproducable ---- Version 0.0.6 --- -Initial ChangeLog entry -No change from v0.0.5 except Makefile/config system cleanup. +2001-01-24 11:21 bradleyb + + * INSTALL, NEWS, README, cvshowto.txt: updated documentation + +2001-01-24 11:20 bradleyb + + * tools/: Makefile.am, cvs2cl/Makefile.am, cvs2cl/cvs2cl.pl: cvs2cl + for building ChangeLog from RCS entries + +2001-01-24 11:11 bradleyb + + * Makefile.am, acconfig.h, autogen.sh, conf.h.in, configure.in, + arch/dos/allg_snd/Makefile.am, arch/dos/allg_snd/sound/Makefile.am, + arch/dos/allg_snd/sound/drv/Makefile.am, arch/dos/bak/Makefile.am, + arch/dos/comm/Makefile.am, arch/dos/comm/include/Makefile.am, + arch/dos/include/Makefile.am, 2d/Makefile.am, 3d/Makefile.am, + arch/Makefile.am, arch/dos/Makefile.am, + arch/dos/mm_snd/Makefile.am, arch/dos/mm_snd/include/Makefile.am, + arch/linux/Makefile.am, arch/linux/include/Makefile.am, + arch/linux/svgalib/Makefile.am, + arch/linux/svgalib/include/Makefile.am, arch/ogl/Makefile.am, + arch/ogl/include/Makefile.am, arch/sdl/Makefile.am, + arch/win32/Makefile.am, arch/win32/d3dframe/Makefile.am, + arch/win32/include/Makefile.am, cfile/Makefile.am, iff/Makefile.am, + iff/archive/Makefile.am, includes/Makefile.am, input/Makefile.am, + input/ggi/Makefile.am, input/ggi/include/Makefile.am, + input/linux/Makefile.am, input/linux/include/Makefile.am, + input/sdl/Makefile.am, input/sdl/include/Makefile.am, + input/svgalib/Makefile.am, input/svgalib/include/Makefile.am, + main/editor/Makefile.am, main/old/Makefile.am, unused/Makefile.am, + unused/bios/Makefile.am, unused/lib/Makefile.am, + unused/novga/Makefile.am, unused/pa_null/Makefile.am, + unused/ui/Makefile.am, unused/vga/Makefile.am, + unused/vga/new/Makefile.am, unused/win95/Makefile.am, + main/Makefile.am, maths/Makefile.am, misc/Makefile.am, + sound/Makefile.am, texmap/Makefile.am, video/Makefile.am: improved + automake config. make dist, VPATH builds, ... + +2001-01-24 11:05 bradleyb + + * configure, Makefile.in, stamp-h.in, 2d/Makefile.in, + 3d/Makefile.in, arch/Makefile.in, arch/dos/Makefile.in, + arch/linux/Makefile.in, arch/sdl/Makefile.in, cfile/Makefile.in, + iff/Makefile.in, input/Makefile.in, input/ggi/Makefile.in, + input/linux/Makefile.in, input/sdl/Makefile.in, main/Makefile.in, + maths/Makefile.in, mem/Makefile.in, misc/Makefile.in, + sound/Makefile.in, texmap/Makefile.in, video/Makefile.in: cruft + removal + +2001-01-24 10:48 bradleyb + + * 2d/diff, arch/dos/sgrep.out, arch/linux/stHqFIq1, main/test.txt: + junk removal + +2001-01-24 10:47 bradleyb + + * libtool, ltconfig, ltmain.sh: cruft removal + +2001-01-24 05:43 bradleyb + + * ChangeLog, NEWS: moved old ChangeLog to NEWS + +2001-01-24 05:35 bradleyb + + * configure.in, conf.h.in: moved NDEBUG to conf.h.in + +2001-01-24 04:42 bradleyb + + * main/: game.c, kconfig.c, text.c: changed args_find to FindArg + +2001-01-24 04:38 bradleyb + + * main/: gamecntl.c, inferno.c: changed args_find to FindArg, added + -grabmouse option + +2001-01-24 04:29 bradleyb + + * arch/dos_init.c, arch/linux_init.c, arch/linux_ipx_udp.c, + arch/linux_net.c, arch/sdl_init.c, arch/dos/init.c, + arch/dos/joyc.c, arch/linux/init.c, arch/linux/ipx_udp.c, + arch/linux/linuxnet.c, arch/sdl/init.c, includes/args.h, + input/dos_joyc.c, input/svgalib_init.c, main/config.c, main/hud.c, + main/menu.c, main/multi.c, main/network.c, main/piggy.c, + main/polyobj.c, main/slew.c, main/songs.c, misc/args.c, + sound/sdl_cdrom.c, video/ogl_gr.c, video/sdl_gr.c: changed + args_find to FindArg + +2001-01-22 15:50 bradleyb + + * configure, main/Makefile.am, main/Makefile.in, video/Makefile.am, + video/Makefile.in, video/ogl_gr.c: configuration fixes + +2001-01-22 15:49 bradleyb + + * includes/error.h, includes/mono.h, main/game.c, main/gamerend.c, + video/ogl.c: fix compiler warnings w/opengl + +2001-01-22 15:45 bradleyb + + * includes/console.h: ggi support + +2001-01-22 15:42 bradleyb + + * input/ggi_event.c, input/ggi_init.c, input/ggi_key.c, + input/ggi_mouse.c, input/ggi/include/key.h, video/ggi_gr.c: ggi + support + +2001-01-22 14:58 bradleyb + + * arch/linux_init.c, input/svgalib_init.c: svgalib support + +2001-01-22 13:39 bradleyb + + * Makefile.in, conf.h.in, configure, configure.in, 2d/Makefile.am, + 2d/Makefile.in, 3d/Makefile.in, arch/Makefile.am, arch/Makefile.in, + arch/svgalib_init.c, cfile/Makefile.in, iff/Makefile.in, + input/Makefile.am, input/Makefile.in, main/Makefile.am, + main/Makefile.in, maths/Makefile.am, maths/Makefile.in, + mem/Makefile.in, misc/Makefile.in, sound/Makefile.in, + texmap/Makefile.am, texmap/Makefile.in, video/Makefile.am, + video/Makefile.in: configuration fixes + +2001-01-22 13:38 bradleyb + + * input/svgalib_init.c: svgalib support + +2001-01-22 13:37 bradleyb + + * iff/iff.c, includes/u_mem.h: NDEBUG fixes + +2001-01-22 13:22 bradleyb + + * main/: ai.h, inferno.c, lighting.c, object.c, render.c: fix + warnings and enable NDEBUG + +2001-01-22 13:04 bradleyb + + * input/Makefile.am: svgalib support + +2001-01-22 13:00 bradleyb + + * input/svgalib/include/: event.h, key.h, mouse.h: svgalib support + +2001-01-22 12:54 bradleyb + + * ChangeLog: joystick support + +2001-01-22 12:51 bradleyb + + * arch/svgalib_init.c, input/svgalib_event.c, input/svgalib_key.c, + input/svgalib_mouse.c, video/svgalib_gr.c: svgalib support + +2001-01-22 12:45 bradleyb + + * input/linux_joystick.c: joystick support + +2001-01-22 12:27 bradleyb + + * input/linux/joystick.c, input/linux/include/joy.h, + main/kconfig.c: joystick support + +2001-01-21 14:59 bradleyb + + * cvshowto.txt: new file, taken from d1x webpage + +2001-01-21 14:58 bradleyb + + * AUTHORS, README: Taking over as maintainer of d2x + +2001-01-21 14:57 bradleyb + + * ChangeLog: Grab mouse with SDL/X11 + +2001-01-21 14:49 bradleyb + + * main/: gamecntl.c, inferno.c: Grab mouse with SDL/X11 + +2001-01-20 13:56 bradleyb + + * configure, configure.in: Turned -Werror back off by default + +2001-01-20 13:49 bradleyb + + * README, configure, configure.in, 2d/font.c, arch/sdl_init.c, + iff/iff.c, includes/3d.h, includes/d_io.h, + input/linux/include/joy.h, input/sdl/include/key.h, + main/Makefile.am, main/Makefile.in, main/bm.c, main/collide.c, + main/credits.c, main/fuelcen.h, main/game.c, main/gamecntl.c, + main/gamepal.c, main/gamerend.c, main/gamesave.c, main/gameseg.c, + main/gameseq.c, main/gauges.c, main/kconfig.c, main/kludge.c, + main/kmatrix.c, main/laser.c, main/multi.c, main/network.c, + main/network.h, main/newdemo.c, main/newmenu.c, main/object.c, + main/object.h, main/physics.c, main/piggy.c, main/polyobj.c, + main/state.c, main/switch.c, main/titles.c, main/wall.c: Got rid of + all compiler warnings, for non-OpenGL on linux, anyway... + +2001-01-19 04:21 bradleyb + + * copying: remove duplicate file + +2001-01-19 03:33 bradleyb + + * copying, djgpp.bat, djgpp.sh, video/dos_gr.c, input/dos_joy2.asm, + input/dos_joyc.c, input/dos_joydefs.c, input/dos_key.c, + input/dos_mouse.c, input/ggi_event.c, input/ggi_init.c, + input/ggi_key.c, input/ggi_mouse.c, input/linux_joydefs.c, + input/linux_joystick.c, input/sdl_event.c, input/sdl_key.c, + input/sdl_mouse.c, maths/cvs/Entries, maths/cvs/Repository, + maths/cvs/Root, main/link.bat, misc/dos_disk.h, arch/dos_dpmi.c, + arch/dos_findfile.c, arch/dos_init.c, arch/dos_ipx.c, + arch/dos_modex.asm, arch/dos_timer.asm, arch/dos_tweak.inc, + arch/dos_vesa.c, arch/dos_vgaregs.inc, arch/linux_findfile.c, + arch/linux_init.c, arch/linux_ipx_bsd.c, arch/linux_ipx_lin.c, + arch/linux_ipx_udp.c, arch/linux_net.c, arch/sdl_init.c, + arch/sdl_timer.c, arch/dos/Makefile.am, arch/dos/Makefile.in, + arch/dos/cdrom.c, arch/dos/digi.c, arch/dos/findfile.c, + sound/dos_cdrom.c, sound/dos_digi.c: Initial revision + +2001-01-19 03:33 bradleyb + + * conf.h.in, README, configure, configure.in, copying, djgpp.bat, + djgpp.sh, readme.txt, 2d/canvas.c, 2d/diff, 2d/line.c, + 2d/2dsline.c, 2d/bitblt.c, 2d/box.c, 2d/gpixel.c, 2d/linear.h, + 2d/pixel.c, maths/vecmat.c, video/Makefile.am, video/Makefile.in, + video/dos_gr.c, input/Makefile.am, input/Makefile.in, + input/dos_joy2.asm, input/dos_joyc.c, input/dos_joydefs.c, + input/dos_key.c, input/dos_mouse.c, input/ggi_event.c, + input/ggi_init.c, input/ggi_key.c, input/ggi_mouse.c, + input/linux_joydefs.c, input/linux_joystick.c, input/sdl_event.c, + input/sdl_key.c, input/sdl_mouse.c, input/ggi/Makefile.in, + input/linux/Makefile.in, input/sdl/Makefile.in, main/digi.h, + main/kconfig.c, maths/cvs/Entries, maths/cvs/Repository, + maths/cvs/Root, main/Makefile.am, main/console.c, main/inferno.c, + main/kludge.c, main/multi.c, main/inferno.ini, main/network.c, + main/config.c, main/gamerend.c, main/Makefile.in, main/link.bat, + misc/d_io.c, misc/dos_disk.h, misc/strutil.c, unused/bios/dd.bat, + unused/bios/mouse.asm, unused/bios/d.bat, unused/bios/joy.asm, + unused/bios/key.asm, unused/bios/keys.inc, + unused/bios/make0000.bat, unused/bios/make0001.bat, + unused/bios/make0100.bat, unused/bios/oldkey.asm, + unused/bios/rbaudio.new, unused/bios/testk.lnk, + unused/bios/testm.lnk, unused/bios/timer.asm, unused/bios/x, + unused/bios/x.bat, unused/bios/y.bat, unused/win95/dd.bat, + arch/Makefile.am, arch/Makefile.in, arch/dos_dpmi.c, + arch/dos_findfile.c, arch/dos_init.c, arch/dos_ipx.c, + arch/dos_modex.asm, arch/dos_timer.asm, arch/dos_tweak.inc, + arch/dos_vesa.c, arch/dos_vgaregs.inc, arch/linux_findfile.c, + arch/linux_init.c, arch/linux_ipx_bsd.c, arch/linux_ipx_lin.c, + arch/linux_ipx_udp.c, unused/vga/dd.bat, unused/vga/framebuf.jas, + unused/vga/modex.asm, unused/vga/tweak.inc, unused/vga/vesa.asm, + unused/vga/vga.jas, unused/vga/vgaregs.inc, unused/vga/xyz.bat, + unused/win95/winckpit.asm, arch/linux_net.c, arch/sdl_init.c, + arch/sdl_timer.c, arch/dos/Makefile.am, arch/dos/Makefile.in, + arch/dos/cdrom.c, arch/dos/digi.c, arch/dos/disk.c, + arch/dos/dosgr.c, arch/dos/dpmi.c, arch/dos/findfile.c, + arch/dos/init.c, arch/dos/joyc.c, arch/dos/joydefs.c, + arch/dos/key.c, arch/dos/mouse.c, arch/dos/vesa.c, + arch/dos/include/joy.h, arch/dos/include/key.h, + arch/dos/include/mouse.h, arch/linux/Makefile.am, + arch/linux/findfile.c, arch/linux/ipx_lin.c, arch/linux/linuxnet.c, + arch/linux/init.c, arch/linux/ipx_bsd.c, arch/linux/ipx_udp.c, + arch/linux/Makefile.in, arch/sdl/Makefile.in, sound/Makefile.am, + sound/sdl_cdrom.c, sound/sdl_digi.c, includes/d.bat, + includes/d_io.h, includes/dtypes.inc, includes/gr.h, + includes/grdef.h, includes/lst.bat, includes/m.bat, + includes/psmacros.inc, includes/pstypes.h, includes/pstypes.inc, + includes/strutil.h, includes/test.lnk, includes/timer.h, + sound/Makefile.in, sound/dos_cdrom.c, sound/dos_digi.c: Import of + d2x-0.0.9-pre1 + +2001-01-19 03:29 bradleyb + + * AUTHORS, COPYING, Makefile.am, aclocal.m4, autogen.sh, conf.h.in, + config.sub, configure, ltconfig, readme.txt, stamp-h.in, ChangeLog, + INSTALL, Makefile.in, config.guess, configure.in, libtool, missing, + mkinstalldirs, NEWS, README, install-sh, ltmain.sh, thinking.txt, + 2d/Makefile.am, 2d/bitmap.h, 2d/canvas.c, 2d/disc.c, 2d/ibitblt.c, + 2d/line.c, 2d/tmerge_a.asm, 2d/bitblt.c, 2d/bitmap.c, 2d/box.c, + 2d/circle.c, 2d/clip.h, 2d/diff, 2d/font.c, 2d/linear.asm, + 2d/linear.h, 2d/pcx.c, 2d/pixel.c, 2d/poly.c, 2d/rle.c, 2d/scale.c, + 2d/scalea.asm, 2d/scalec.c, 2d/tmerge.c, 2d/2dsline.c, + 2d/Makefile.in, 2d/gpixel.c, 2d/palette.c, 2d/rect.c, 2d/scalea.h, + 3d/Makefile.am, 3d/Makefile.in, 3d/clipper.c, 3d/clipper.h, + 3d/draw.c, 3d/globvars.c, 3d/globvars.h, 3d/instance.c, + 3d/interp.asm, 3d/interp.c, 3d/matrix.c, 3d/points.c, 3d/rod.c, + 3d/setup.c, iff/Makefile.am, iff/Makefile.in, iff/iff.c, + iff/archive/iff15bpp.c, iff/archive/iff8bpp.c, + iff/archive/iffmike.c, iff/archive/ifftest.c, + iff/archive/ifftestv.c, input/Makefile.am, input/Makefile.in, + input/linux/Makefile.am, input/linux/Makefile.in, + input/linux/joystick.c, maths/Makefile.am, maths/Makefile.in, + maths/fix.asm, maths/fixc.c, maths/rand.c, maths/tables.c, + maths/vecmat.c, maths/vecmata.asm, mem/Makefile.am, + mem/Makefile.in, mem/mem.c, video/Makefile.am, video/Makefile.in, + video/ggi_gr.c, video/ogl.c, video/ogl_glx.c, video/ogl_gr.c, + video/ogl_wgl.c, video/sdl_gr.c, cfile/Makefile.am, + cfile/Makefile.in, cfile/cfile.c, cfile/nocfile.h, + input/ggi/Makefile.am, input/ggi/Makefile.in, input/ggi/event.c, + input/ggi/init.c, input/ggi/key.c, input/ggi/mouse.c, + input/ggi/include/event.h, input/ggi/include/key.h, + input/ggi/include/mouse.h, input/linux/joydefs.c, + input/linux/include/joy.h, input/linux/include/joystick.h, + input/sdl/Makefile.am, input/sdl/Makefile.in, input/sdl/event.c, + input/sdl/key.c, input/sdl/mouse.c, input/sdl/include/event.h, + input/sdl/include/key.h, input/sdl/include/mouse.h, + main/Makefile.am, main/bm.h, main/cdrom.h, main/cntrlcen.c, + main/collide.h, main/compbit.h, main/config.h, main/console.c, + main/controls.h, main/desc_id.h, main/digi.h, main/fuelcen.c, + main/fvi.h, main/game.h, main/gamepal.h, main/gamesave.c, + main/gamesave.h, main/gameseq.h, main/hostage.c, main/kconfig.c, + main/kconfig.h, main/kmatrix.c, main/menu.c, main/mglobal.c, + main/mission.h, main/object.h, main/paging.c, main/paging.h, + main/playsave.h, main/robot.h, main/slew.h, main/switch.h, + main/text.h, main/vclip.c, main/weapon.c, main/automap.h, + main/collide.c, main/descent.cfg, main/dumpmine.c, main/effects.c, + main/escort.c, main/fireball.h, main/gamemine.h, main/gamepal.c, + main/gauges.c, main/hostage.h, main/hud.c, main/inferno.c, + main/kludge.c, main/lighting.c, main/morph.h, main/movie.h, + main/object.c, main/physics.h, main/polyobj.h, main/screens.h, + main/segment.h, main/songs.h, main/sounds.h, main/state.c, + main/state.h, main/terrain.h, main/test.txt, main/textures.h, + main/wall.c, main/wall.h, main/ai2.c, main/aistruct.h, main/bm.c, + main/bmread.c, main/bmread.h, main/cmd.c, main/controls.c, + main/crypt.c, main/endlevel.c, main/endlevel.h, main/fireball.c, + main/fvi.c, main/fvi_a.h, main/game.c, main/gamemine.c, + main/gameseg.c, main/gameseg.h, main/gauges.h, main/inferno.ini, + main/lighting.h, main/menu.h, main/modem.h, main/multi.c, + main/multibot.h, main/netmisc.c, main/netmisc.h, main/newdemo.c, + main/newmenu.c, main/physics.c, main/piggy.h, main/player.h, + main/polyobj.c, main/render.c, main/scores.c, main/segpoint.h, + main/slew.c, main/switch.c, main/texmerge.h, main/text.c, + main/titles.c, main/titles.h, main/weapon.h, main/ai.c, + main/automap.c, main/cntrlcen.h, main/config.c, main/credits.h, + main/desw.h, main/gamecntl.c, main/gamerend.c, main/gamestat.h, + main/inferno.h, main/joydefs.h, main/laser.c, main/laser.h, + main/morph.c, main/multi.h, main/network.c, main/piggy.c, + main/playsave.c, main/powerup.c, main/scores.h, main/vclip.h, + main/Makefile.in, main/credits.c, main/fuelcen.h, main/gamefont.c, + main/multibot.c, main/newmenu.h, main/render.h, main/songs.c, + main/ai.h, main/aipath.c, main/effects.h, main/gamefont.h, + main/gameseq.c, main/kmatrix.h, main/mission.c, main/network.h, + main/newdemo.h, main/powerup.h, main/robot.c, main/texmerge.c, + main/vers_id.h, main/editor/editor.h, main/editor/kdefs.h, + main/editor/texpage.h, main/old/coindev.c, main/old/modem.c, + main/old/settings.h, main/old/3dfx.c, main/old/3dfx_des.h, + main/old/arcade.h, main/old/cdmix32.c, main/old/cdrom.c, + main/old/coindev.h, main/old/descentw.c, main/old/digiobj.c, + main/old/files.h, main/old/iglasses.c, main/old/iglasses.h, + main/old/joydefs.c, main/old/joydefsw.c, main/old/movie.c, + main/old/newmodel.c, main/old/rbtest.c, main/old/terrain.c, + main/old/windigi.c, main/old/winferno.c, main/old/winmodem.c, + main/old/winvideo.c, misc/Makefile.am, misc/Makefile.in, + misc/args.c, misc/byteswap.c, misc/byteswap.h, misc/d_delay.c, + misc/d_glob.c, misc/d_io.c, misc/error.c, misc/errtest.c, + misc/fileutil.c, misc/fileutil.h, misc/hash.c, misc/parsarg.c, + misc/parsarg.h, misc/parstest.c, misc/strio.c, misc/strutil.c, + unused/readme.txt, unused/bios/d.bat, unused/bios/dd.bat, + unused/bios/dpmi.c, unused/bios/dpmi.h, unused/bios/error.c, + unused/bios/error.h, unused/bios/findfile.c, + unused/bios/findfile.h, unused/bios/ipx.c, unused/bios/ipx.h, + unused/bios/joy.asm, unused/bios/joy.h, unused/bios/joyc.c, + unused/bios/key.asm, unused/bios/key.c, unused/bios/key.h, + unused/bios/keys.inc, unused/bios/make0000.bat, + unused/bios/make0001.bat, unused/bios/make0100.bat, + unused/bios/mono.c, unused/bios/mouse.asm, unused/bios/mouse.c, + unused/bios/mouse.h, unused/bios/oldkey.asm, unused/bios/rbaudio.c, + unused/bios/rbaudio.h, unused/bios/rbaudio.new, + unused/bios/speaker.c, unused/bios/swiftcfg.h, unused/bios/testj.c, + unused/bios/testk.c, unused/bios/testk.lnk, unused/bios/testm.c, + unused/bios/testm.lnk, unused/bios/testms.c, unused/bios/testt.c, + unused/bios/timer.asm, unused/bios/timer.h, unused/bios/timerp.c, + unused/bios/x, unused/bios/x.bat, unused/bios/x.c, + unused/bios/y.bat, unused/pa_null/pa_enabl.h, + unused/pa_null/poly_acc.c, unused/pa_null/poly_acc.h, + unused/ui/gadget.c, unused/ui/icon.c, unused/ui/keypress.c, + unused/ui/keytrap.c, unused/ui/listbox.c, unused/ui/medfunc.c, + unused/ui/menu.c, unused/ui/menubar.c, unused/ui/message.c, + unused/ui/mouse.c, unused/ui/number.c, unused/ui/popup.c, + unused/ui/radio.c, unused/ui/scroll.c, unused/ui/ui.h, + arch/Makefile.am, arch/Makefile.in, arch/dos/bcd.c, + arch/dos/digiallg.c, arch/dos/digimm.c, arch/dos/disk.c, + arch/dos/dosgr.c, arch/dos/dpmi.c, arch/dos/init.c, arch/dos/ipx.c, + arch/dos/ipx.h, arch/dos/joy2.asm, arch/dos/joyc.c, + arch/dos/joydefs.c, arch/dos/key.c, arch/dos/midiallg.c, + arch/dos/modex.asm, arch/dos/mono.c, arch/dos/mono.h, + arch/dos/mouse.c, arch/dos/serial.c, arch/dos/sgrep.out, + arch/dos/timer.asm, arch/dos/tweak.inc, arch/dos/vesa.c, + arch/dos/vgaregs.inc, arch/dos/allg_snd/allg_snd.c, + arch/dos/allg_snd/internal.h, arch/dos/allg_snd/sound/allegro.h, + arch/dos/allg_snd/sound/config.c, arch/dos/allg_snd/sound/digmid.c, + arch/dos/allg_snd/sound/interndj.h, arch/dos/allg_snd/sound/midi.c, + arch/dos/allg_snd/sound/mixer.c, arch/dos/allg_snd/sound/readme.d1, + arch/dos/allg_snd/sound/readme.txt, + arch/dos/allg_snd/sound/snddrv.c, arch/dos/allg_snd/sound/sound.c, + arch/dos/allg_snd/sound/drv/adlib.c, + arch/dos/allg_snd/sound/drv/awedata.c, + arch/dos/allg_snd/sound/drv/dma.c, + arch/dos/allg_snd/sound/drv/emu8k.c, + arch/dos/allg_snd/sound/drv/emu8k.h, + arch/dos/allg_snd/sound/drv/emu8kmid.c, + arch/dos/allg_snd/sound/drv/fm_instr.h, + arch/dos/allg_snd/sound/drv/gus.c, + arch/dos/allg_snd/sound/drv/mpu.c, + arch/dos/allg_snd/sound/drv/sb.c, arch/dos/bak/ipx.c, + arch/dos/comm/commlib.c, arch/dos/comm/dzcomm.c, + arch/dos/comm/dzqueue.c, arch/dos/comm/irq.c, + arch/dos/comm/irqwrap.S, arch/dos/comm/include/allegro.h, + arch/dos/comm/include/asmdef.inc, + arch/dos/comm/include/asmdefs.inc, arch/dos/comm/include/commlib.h, + arch/dos/comm/include/internal.h, arch/dos/include/commlib.h, + arch/dos/include/disk.h, arch/dos/include/dzcomm.h, + arch/dos/include/joy.h, arch/dos/include/key.h, + arch/dos/include/midiallg.h, arch/dos/include/mouse.h, + arch/dos/include/serial.h, arch/dos/mm_snd/drv_sb.c, + arch/dos/mm_snd/mdma.c, arch/dos/mm_snd/mirq.c, + arch/dos/mm_snd/readme.txt, arch/dos/mm_snd/include/mdma.h, + arch/dos/mm_snd/include/mikmod.h, arch/dos/mm_snd/include/mirq.h, + arch/dos/mm_snd/include/mm_drv.h, arch/dos/mm_snd/include/mmio.h, + arch/dos/mm_snd/include/mtypes.h, arch/linux/Makefile.am, + arch/linux/Makefile.in, arch/linux/alsadigi.c, + arch/linux/findfile.c, arch/linux/hmiplay.c, arch/linux/hmistub.c, + arch/linux/init.c, arch/linux/ipx_bsd.c, arch/linux/ipx_kali.c, + arch/linux/ipx_lin.c, arch/linux/ipx_udp.c, arch/linux/linuxnet.c, + arch/linux/mono.c, arch/linux/serial.c, arch/linux/stHqFIq1, + arch/linux/timer.c, arch/linux/ukali.c, + arch/linux/include/ipx_bsd.h, arch/linux/include/ipx_drv.h, + arch/linux/include/ipx_hlpr.h, arch/linux/include/ipx_kali.h, + arch/linux/include/ipx_ld.h, arch/linux/include/ipx_lin.h, + arch/linux/include/ipx_udp.h, arch/linux/include/music.h, + arch/linux/include/serial.h, arch/linux/include/ukali.h, + arch/linux/svgalib/event.c, arch/linux/svgalib/gr.c, + arch/linux/svgalib/init.c, arch/linux/svgalib/key.c, + arch/linux/svgalib/mouse.c, arch/linux/svgalib/include/event.h, + arch/linux/svgalib/include/key.h, + arch/linux/svgalib/include/mouse.h, arch/ogl/include/loadgl.h, + arch/ogl/include/ogl_init.h, arch/sdl/Makefile.am, arch/sdl/init.c, + arch/sdl/timer.c, arch/win32/d1x.ico, arch/win32/d1x.rc, + arch/win32/d3d.ico, arch/win32/debug.cpp, arch/win32/descent.ico, + arch/win32/digi.c, arch/win32/glinit.c, arch/win32/gr.c, + arch/win32/hmpfile.c, arch/win32/init.c, arch/win32/ipx_drv.h, + arch/win32/ipx_win.c, arch/win32/joydefs.c, arch/win32/joyhh.c, + arch/win32/key.c, arch/win32/mono.c, arch/win32/mouse.c, + arch/win32/palw32.c, arch/win32/pch.cpp, arch/win32/scene.cpp, + arch/win32/serial.c, arch/win32/texture.cpp, arch/win32/timer.c, + arch/win32/win32.c, arch/win32/winmain.cpp, arch/win32/winnet.c, + arch/win32/d3dframe/d3denum.cpp, arch/win32/d3dframe/d3denum.h, + arch/win32/d3dframe/d3dframe.cpp, arch/win32/d3dframe/d3dframe.h, + arch/win32/d3dframe/d3dmath.cpp, arch/win32/d3dframe/d3dmath.h, + arch/win32/d3dframe/d3dtextr.cpp, arch/win32/d3dframe/d3dtextr.h, + arch/win32/d3dframe/d3dutil.cpp, arch/win32/d3dframe/d3dutil.h, + arch/win32/d3dframe/ddenum.cpp, arch/win32/d3dframe/ddmm.h, + arch/win32/d3dframe/ddutil.h, arch/win32/d3dframe/ddutil2.h, + arch/win32/d3dframe/dsutil.h, arch/win32/d3dframe/lbprintf.h, + arch/win32/d3dframe/resource.h, arch/win32/d3dframe/userdlg.cpp, + arch/win32/include/d3dhelp.h, arch/win32/include/debug.h, + arch/win32/include/hmpfile.h, arch/win32/include/joy.h, + arch/win32/include/key.h, arch/win32/include/mouse.h, + arch/win32/include/pch.h, arch/win32/include/resource.h, + arch/win32/include/scene.h, arch/win32/include/serial.h, + arch/win32/include/texture.h, arch/win32/include/winmain.h, + arch/win32/include/wsipx.h, unused/lib/fix.h, unused/lib/rbaudio.h, + unused/novga/files.rc, unused/novga/novesa.c, unused/ui/barbox.c, + unused/ui/button.c, unused/ui/checkbox.c, unused/ui/file.c, + unused/ui/func.c, unused/ui/func.h, unused/ui/harderr.c, + unused/ui/inputbox.c, unused/ui/keypad.c, unused/ui/ui.c, + unused/ui/uidraw.c, unused/ui/userbox.c, unused/ui/window.c, + unused/vga/dd.bat, unused/vga/framebuf.c, unused/vga/framebuf.jas, + unused/vga/fxdpmi.h, unused/vga/fxvesa.h, unused/vga/grx.h, + unused/vga/modex.asm, unused/vga/palette.c, unused/vga/tweak.inc, + unused/vga/vesa.asm, unused/vga/vga.c, unused/vga/vga.h, + unused/vga/vga.jas, unused/vga/vgaregs.inc, unused/vga/xyz.bat, + unused/vga/new/palette.c, unused/vga/new/vga.c, + unused/win95/comm.c, unused/win95/comm.h, unused/win95/dd.bat, + unused/win95/dd.c, unused/win95/dd.h, unused/win95/ddgfx.c, + unused/win95/ddgr.c, unused/win95/ddraw.c, unused/win95/direct3d.c, + unused/win95/direct3d.h, unused/win95/ds.c, unused/win95/ds.h, + unused/win95/error.c, unused/win95/error.h, + unused/win95/findfile.c, unused/win95/gfx.c, unused/win95/global.h, + unused/win95/iforce.c, unused/win95/iforce.h, unused/win95/ipx.c, + unused/win95/joyc.c, unused/win95/key.c, unused/win95/midifile.h, + unused/win95/midiseq.h, unused/win95/mono.c, unused/win95/mouse.c, + unused/win95/palette.c, unused/win95/rbaudio.c, + unused/win95/swift.c, unused/win95/tactile.c, + unused/win95/tactile.h, unused/win95/timer.c, + unused/win95/winapp.c, unused/win95/winapp.h, + unused/win95/winckpit.asm, unused/win95/winmidi.c, + unused/win95/winmidi.h, unused/win95/winmono.c, + unused/win95/winregs.c, unused/win95/winregs.h, + unused/win95/xtapi.c, unused/win95/xtapi.h, arch/sdl/Makefile.in, + includes/3d.h, includes/args.h, includes/byteswap.h, + includes/cfile.h, includes/checker.h, includes/cmd.h, + includes/console.h, includes/d.bat, includes/d_delay.h, + includes/d_io.h, includes/dtypes.h, includes/dtypes.inc, + includes/error.h, includes/findfile.h, includes/fix.h, + includes/gr.h, includes/grdef.h, includes/hash.h, + includes/ibitblt.h, includes/iff.h, includes/ipx.h, + includes/loadgl.h, includes/lst.bat, includes/m.bat, + includes/maths.h, includes/modex.h, includes/mono.h, + includes/ogl_init.h, includes/pa_enabl.h, includes/palette.h, + includes/pcx.h, includes/psmacros.inc, includes/pstypes.h, + includes/pstypes.inc, includes/rle.h, includes/strio.h, + includes/strutil.h, includes/test.c, includes/test.lnk, + includes/texmap.h, includes/timer.h, includes/u_dpmi.h, + includes/u_mem.h, includes/vecmat.h, includes/vesa.h, + sound/Makefile.am, sound/Makefile.in, sound/sdl_cdrom.c, + sound/sdl_digi.c, texmap/Makefile.am, texmap/Makefile.in, + texmap/ntmap.c, texmap/scanline.c, texmap/scanline.h, + texmap/texmapl.h, texmap/tmap_flt.asm, texmap/tmap_inc.asm, + texmap/tmap_lin.asm, texmap/tmap_ll.asm, texmap/tmap_per.asm, + texmap/tmapfade.asm, texmap/tmapflat.c, texmap/tmappent.S, + texmap/tmapppro.S: Initial revision + +2001-01-19 03:29 bradleyb + + * AUTHORS, COPYING, Makefile.am, aclocal.m4, autogen.sh, conf.h.in, + config.sub, configure, ltconfig, readme.txt, stamp-h.in, ChangeLog, + INSTALL, Makefile.in, config.guess, configure.in, libtool, missing, + mkinstalldirs, NEWS, README, install-sh, ltmain.sh, thinking.txt, + 2d/Makefile.am, 2d/bitmap.h, 2d/canvas.c, 2d/disc.c, 2d/ibitblt.c, + 2d/line.c, 2d/tmerge_a.asm, 2d/bitblt.c, 2d/bitmap.c, 2d/box.c, + 2d/circle.c, 2d/clip.h, 2d/diff, 2d/font.c, 2d/linear.asm, + 2d/linear.h, 2d/pcx.c, 2d/pixel.c, 2d/poly.c, 2d/rle.c, 2d/scale.c, + 2d/scalea.asm, 2d/scalec.c, 2d/tmerge.c, 2d/2dsline.c, + 2d/Makefile.in, 2d/gpixel.c, 2d/palette.c, 2d/rect.c, 2d/scalea.h, + 3d/Makefile.am, 3d/Makefile.in, 3d/clipper.c, 3d/clipper.h, + 3d/draw.c, 3d/globvars.c, 3d/globvars.h, 3d/instance.c, + 3d/interp.asm, 3d/interp.c, 3d/matrix.c, 3d/points.c, 3d/rod.c, + 3d/setup.c, iff/Makefile.am, iff/Makefile.in, iff/iff.c, + iff/archive/iff15bpp.c, iff/archive/iff8bpp.c, + iff/archive/iffmike.c, iff/archive/ifftest.c, + iff/archive/ifftestv.c, input/Makefile.am, input/Makefile.in, + input/linux/Makefile.am, input/linux/Makefile.in, + input/linux/joystick.c, maths/Makefile.am, maths/Makefile.in, + maths/fix.asm, maths/fixc.c, maths/rand.c, maths/tables.c, + maths/vecmat.c, maths/vecmata.asm, mem/Makefile.am, + mem/Makefile.in, mem/mem.c, video/Makefile.am, video/Makefile.in, + video/ggi_gr.c, video/ogl.c, video/ogl_glx.c, video/ogl_gr.c, + video/ogl_wgl.c, video/sdl_gr.c, cfile/Makefile.am, + cfile/Makefile.in, cfile/cfile.c, cfile/nocfile.h, + input/ggi/Makefile.am, input/ggi/Makefile.in, input/ggi/event.c, + input/ggi/init.c, input/ggi/key.c, input/ggi/mouse.c, + input/ggi/include/event.h, input/ggi/include/key.h, + input/ggi/include/mouse.h, input/linux/joydefs.c, + input/linux/include/joy.h, input/linux/include/joystick.h, + input/sdl/Makefile.am, input/sdl/Makefile.in, input/sdl/event.c, + input/sdl/key.c, input/sdl/mouse.c, input/sdl/include/event.h, + input/sdl/include/key.h, input/sdl/include/mouse.h, + main/Makefile.am, main/bm.h, main/cdrom.h, main/cntrlcen.c, + main/collide.h, main/compbit.h, main/config.h, main/console.c, + main/controls.h, main/desc_id.h, main/digi.h, main/fuelcen.c, + main/fvi.h, main/game.h, main/gamepal.h, main/gamesave.c, + main/gamesave.h, main/gameseq.h, main/hostage.c, main/kconfig.c, + main/kconfig.h, main/kmatrix.c, main/menu.c, main/mglobal.c, + main/mission.h, main/object.h, main/paging.c, main/paging.h, + main/playsave.h, main/robot.h, main/slew.h, main/switch.h, + main/text.h, main/vclip.c, main/weapon.c, main/automap.h, + main/collide.c, main/descent.cfg, main/dumpmine.c, main/effects.c, + main/escort.c, main/fireball.h, main/gamemine.h, main/gamepal.c, + main/gauges.c, main/hostage.h, main/hud.c, main/inferno.c, + main/kludge.c, main/lighting.c, main/morph.h, main/movie.h, + main/object.c, main/physics.h, main/polyobj.h, main/screens.h, + main/segment.h, main/songs.h, main/sounds.h, main/state.c, + main/state.h, main/terrain.h, main/test.txt, main/textures.h, + main/wall.c, main/wall.h, main/ai2.c, main/aistruct.h, main/bm.c, + main/bmread.c, main/bmread.h, main/cmd.c, main/controls.c, + main/crypt.c, main/endlevel.c, main/endlevel.h, main/fireball.c, + main/fvi.c, main/fvi_a.h, main/game.c, main/gamemine.c, + main/gameseg.c, main/gameseg.h, main/gauges.h, main/inferno.ini, + main/lighting.h, main/menu.h, main/modem.h, main/multi.c, + main/multibot.h, main/netmisc.c, main/netmisc.h, main/newdemo.c, + main/newmenu.c, main/physics.c, main/piggy.h, main/player.h, + main/polyobj.c, main/render.c, main/scores.c, main/segpoint.h, + main/slew.c, main/switch.c, main/texmerge.h, main/text.c, + main/titles.c, main/titles.h, main/weapon.h, main/ai.c, + main/automap.c, main/cntrlcen.h, main/config.c, main/credits.h, + main/desw.h, main/gamecntl.c, main/gamerend.c, main/gamestat.h, + main/inferno.h, main/joydefs.h, main/laser.c, main/laser.h, + main/morph.c, main/multi.h, main/network.c, main/piggy.c, + main/playsave.c, main/powerup.c, main/scores.h, main/vclip.h, + main/Makefile.in, main/credits.c, main/fuelcen.h, main/gamefont.c, + main/multibot.c, main/newmenu.h, main/render.h, main/songs.c, + main/ai.h, main/aipath.c, main/effects.h, main/gamefont.h, + main/gameseq.c, main/kmatrix.h, main/mission.c, main/network.h, + main/newdemo.h, main/powerup.h, main/robot.c, main/texmerge.c, + main/vers_id.h, main/editor/editor.h, main/editor/kdefs.h, + main/editor/texpage.h, main/old/coindev.c, main/old/modem.c, + main/old/settings.h, main/old/3dfx.c, main/old/3dfx_des.h, + main/old/arcade.h, main/old/cdmix32.c, main/old/cdrom.c, + main/old/coindev.h, main/old/descentw.c, main/old/digiobj.c, + main/old/files.h, main/old/iglasses.c, main/old/iglasses.h, + main/old/joydefs.c, main/old/joydefsw.c, main/old/movie.c, + main/old/newmodel.c, main/old/rbtest.c, main/old/terrain.c, + main/old/windigi.c, main/old/winferno.c, main/old/winmodem.c, + main/old/winvideo.c, misc/Makefile.am, misc/Makefile.in, + misc/args.c, misc/byteswap.c, misc/byteswap.h, misc/d_delay.c, + misc/d_glob.c, misc/d_io.c, misc/error.c, misc/errtest.c, + misc/fileutil.c, misc/fileutil.h, misc/hash.c, misc/parsarg.c, + misc/parsarg.h, misc/parstest.c, misc/strio.c, misc/strutil.c, + unused/readme.txt, unused/bios/d.bat, unused/bios/dd.bat, + unused/bios/dpmi.c, unused/bios/dpmi.h, unused/bios/error.c, + unused/bios/error.h, unused/bios/findfile.c, + unused/bios/findfile.h, unused/bios/ipx.c, unused/bios/ipx.h, + unused/bios/joy.asm, unused/bios/joy.h, unused/bios/joyc.c, + unused/bios/key.asm, unused/bios/key.c, unused/bios/key.h, + unused/bios/keys.inc, unused/bios/make0000.bat, + unused/bios/make0001.bat, unused/bios/make0100.bat, + unused/bios/mono.c, unused/bios/mouse.asm, unused/bios/mouse.c, + unused/bios/mouse.h, unused/bios/oldkey.asm, unused/bios/rbaudio.c, + unused/bios/rbaudio.h, unused/bios/rbaudio.new, + unused/bios/speaker.c, unused/bios/swiftcfg.h, unused/bios/testj.c, + unused/bios/testk.c, unused/bios/testk.lnk, unused/bios/testm.c, + unused/bios/testm.lnk, unused/bios/testms.c, unused/bios/testt.c, + unused/bios/timer.asm, unused/bios/timer.h, unused/bios/timerp.c, + unused/bios/x, unused/bios/x.bat, unused/bios/x.c, + unused/bios/y.bat, unused/pa_null/pa_enabl.h, + unused/pa_null/poly_acc.c, unused/pa_null/poly_acc.h, + unused/ui/gadget.c, unused/ui/icon.c, unused/ui/keypress.c, + unused/ui/keytrap.c, unused/ui/listbox.c, unused/ui/medfunc.c, + unused/ui/menu.c, unused/ui/menubar.c, unused/ui/message.c, + unused/ui/mouse.c, unused/ui/number.c, unused/ui/popup.c, + unused/ui/radio.c, unused/ui/scroll.c, unused/ui/ui.h, + arch/Makefile.am, arch/Makefile.in, arch/dos/bcd.c, + arch/dos/digiallg.c, arch/dos/digimm.c, arch/dos/disk.c, + arch/dos/dosgr.c, arch/dos/dpmi.c, arch/dos/init.c, arch/dos/ipx.c, + arch/dos/ipx.h, arch/dos/joy2.asm, arch/dos/joyc.c, + arch/dos/joydefs.c, arch/dos/key.c, arch/dos/midiallg.c, + arch/dos/modex.asm, arch/dos/mono.c, arch/dos/mono.h, + arch/dos/mouse.c, arch/dos/serial.c, arch/dos/sgrep.out, + arch/dos/timer.asm, arch/dos/tweak.inc, arch/dos/vesa.c, + arch/dos/vgaregs.inc, arch/dos/allg_snd/allg_snd.c, + arch/dos/allg_snd/internal.h, arch/dos/allg_snd/sound/allegro.h, + arch/dos/allg_snd/sound/config.c, arch/dos/allg_snd/sound/digmid.c, + arch/dos/allg_snd/sound/interndj.h, arch/dos/allg_snd/sound/midi.c, + arch/dos/allg_snd/sound/mixer.c, arch/dos/allg_snd/sound/readme.d1, + arch/dos/allg_snd/sound/readme.txt, + arch/dos/allg_snd/sound/snddrv.c, arch/dos/allg_snd/sound/sound.c, + arch/dos/allg_snd/sound/drv/adlib.c, + arch/dos/allg_snd/sound/drv/awedata.c, + arch/dos/allg_snd/sound/drv/dma.c, + arch/dos/allg_snd/sound/drv/emu8k.c, + arch/dos/allg_snd/sound/drv/emu8k.h, + arch/dos/allg_snd/sound/drv/emu8kmid.c, + arch/dos/allg_snd/sound/drv/fm_instr.h, + arch/dos/allg_snd/sound/drv/gus.c, + arch/dos/allg_snd/sound/drv/mpu.c, + arch/dos/allg_snd/sound/drv/sb.c, arch/dos/bak/ipx.c, + arch/dos/comm/commlib.c, arch/dos/comm/dzcomm.c, + arch/dos/comm/dzqueue.c, arch/dos/comm/irq.c, + arch/dos/comm/irqwrap.S, arch/dos/comm/include/allegro.h, + arch/dos/comm/include/asmdef.inc, + arch/dos/comm/include/asmdefs.inc, arch/dos/comm/include/commlib.h, + arch/dos/comm/include/internal.h, arch/dos/include/commlib.h, + arch/dos/include/disk.h, arch/dos/include/dzcomm.h, + arch/dos/include/joy.h, arch/dos/include/key.h, + arch/dos/include/midiallg.h, arch/dos/include/mouse.h, + arch/dos/include/serial.h, arch/dos/mm_snd/drv_sb.c, + arch/dos/mm_snd/mdma.c, arch/dos/mm_snd/mirq.c, + arch/dos/mm_snd/readme.txt, arch/dos/mm_snd/include/mdma.h, + arch/dos/mm_snd/include/mikmod.h, arch/dos/mm_snd/include/mirq.h, + arch/dos/mm_snd/include/mm_drv.h, arch/dos/mm_snd/include/mmio.h, + arch/dos/mm_snd/include/mtypes.h, arch/linux/Makefile.am, + arch/linux/Makefile.in, arch/linux/alsadigi.c, + arch/linux/findfile.c, arch/linux/hmiplay.c, arch/linux/hmistub.c, + arch/linux/init.c, arch/linux/ipx_bsd.c, arch/linux/ipx_kali.c, + arch/linux/ipx_lin.c, arch/linux/ipx_udp.c, arch/linux/linuxnet.c, + arch/linux/mono.c, arch/linux/serial.c, arch/linux/stHqFIq1, + arch/linux/timer.c, arch/linux/ukali.c, + arch/linux/include/ipx_bsd.h, arch/linux/include/ipx_drv.h, + arch/linux/include/ipx_hlpr.h, arch/linux/include/ipx_kali.h, + arch/linux/include/ipx_ld.h, arch/linux/include/ipx_lin.h, + arch/linux/include/ipx_udp.h, arch/linux/include/music.h, + arch/linux/include/serial.h, arch/linux/include/ukali.h, + arch/linux/svgalib/event.c, arch/linux/svgalib/gr.c, + arch/linux/svgalib/init.c, arch/linux/svgalib/key.c, + arch/linux/svgalib/mouse.c, arch/linux/svgalib/include/event.h, + arch/linux/svgalib/include/key.h, + arch/linux/svgalib/include/mouse.h, arch/ogl/include/loadgl.h, + arch/ogl/include/ogl_init.h, arch/sdl/Makefile.am, arch/sdl/init.c, + arch/sdl/timer.c, arch/win32/d1x.ico, arch/win32/d1x.rc, + arch/win32/d3d.ico, arch/win32/debug.cpp, arch/win32/descent.ico, + arch/win32/digi.c, arch/win32/glinit.c, arch/win32/gr.c, + arch/win32/hmpfile.c, arch/win32/init.c, arch/win32/ipx_drv.h, + arch/win32/ipx_win.c, arch/win32/joydefs.c, arch/win32/joyhh.c, + arch/win32/key.c, arch/win32/mono.c, arch/win32/mouse.c, + arch/win32/palw32.c, arch/win32/pch.cpp, arch/win32/scene.cpp, + arch/win32/serial.c, arch/win32/texture.cpp, arch/win32/timer.c, + arch/win32/win32.c, arch/win32/winmain.cpp, arch/win32/winnet.c, + arch/win32/d3dframe/d3denum.cpp, arch/win32/d3dframe/d3denum.h, + arch/win32/d3dframe/d3dframe.cpp, arch/win32/d3dframe/d3dframe.h, + arch/win32/d3dframe/d3dmath.cpp, arch/win32/d3dframe/d3dmath.h, + arch/win32/d3dframe/d3dtextr.cpp, arch/win32/d3dframe/d3dtextr.h, + arch/win32/d3dframe/d3dutil.cpp, arch/win32/d3dframe/d3dutil.h, + arch/win32/d3dframe/ddenum.cpp, arch/win32/d3dframe/ddmm.h, + arch/win32/d3dframe/ddutil.h, arch/win32/d3dframe/ddutil2.h, + arch/win32/d3dframe/dsutil.h, arch/win32/d3dframe/lbprintf.h, + arch/win32/d3dframe/resource.h, arch/win32/d3dframe/userdlg.cpp, + arch/win32/include/d3dhelp.h, arch/win32/include/debug.h, + arch/win32/include/hmpfile.h, arch/win32/include/joy.h, + arch/win32/include/key.h, arch/win32/include/mouse.h, + arch/win32/include/pch.h, arch/win32/include/resource.h, + arch/win32/include/scene.h, arch/win32/include/serial.h, + arch/win32/include/texture.h, arch/win32/include/winmain.h, + arch/win32/include/wsipx.h, unused/lib/fix.h, unused/lib/rbaudio.h, + unused/novga/files.rc, unused/novga/novesa.c, unused/ui/barbox.c, + unused/ui/button.c, unused/ui/checkbox.c, unused/ui/file.c, + unused/ui/func.c, unused/ui/func.h, unused/ui/harderr.c, + unused/ui/inputbox.c, unused/ui/keypad.c, unused/ui/ui.c, + unused/ui/uidraw.c, unused/ui/userbox.c, unused/ui/window.c, + unused/vga/dd.bat, unused/vga/framebuf.c, unused/vga/framebuf.jas, + unused/vga/fxdpmi.h, unused/vga/fxvesa.h, unused/vga/grx.h, + unused/vga/modex.asm, unused/vga/palette.c, unused/vga/tweak.inc, + unused/vga/vesa.asm, unused/vga/vga.c, unused/vga/vga.h, + unused/vga/vga.jas, unused/vga/vgaregs.inc, unused/vga/xyz.bat, + unused/vga/new/palette.c, unused/vga/new/vga.c, + unused/win95/comm.c, unused/win95/comm.h, unused/win95/dd.bat, + unused/win95/dd.c, unused/win95/dd.h, unused/win95/ddgfx.c, + unused/win95/ddgr.c, unused/win95/ddraw.c, unused/win95/direct3d.c, + unused/win95/direct3d.h, unused/win95/ds.c, unused/win95/ds.h, + unused/win95/error.c, unused/win95/error.h, + unused/win95/findfile.c, unused/win95/gfx.c, unused/win95/global.h, + unused/win95/iforce.c, unused/win95/iforce.h, unused/win95/ipx.c, + unused/win95/joyc.c, unused/win95/key.c, unused/win95/midifile.h, + unused/win95/midiseq.h, unused/win95/mono.c, unused/win95/mouse.c, + unused/win95/palette.c, unused/win95/rbaudio.c, + unused/win95/swift.c, unused/win95/tactile.c, + unused/win95/tactile.h, unused/win95/timer.c, + unused/win95/winapp.c, unused/win95/winapp.h, + unused/win95/winckpit.asm, unused/win95/winmidi.c, + unused/win95/winmidi.h, unused/win95/winmono.c, + unused/win95/winregs.c, unused/win95/winregs.h, + unused/win95/xtapi.c, unused/win95/xtapi.h, arch/sdl/Makefile.in, + includes/3d.h, includes/args.h, includes/byteswap.h, + includes/cfile.h, includes/checker.h, includes/cmd.h, + includes/console.h, includes/d.bat, includes/d_delay.h, + includes/d_io.h, includes/dtypes.h, includes/dtypes.inc, + includes/error.h, includes/findfile.h, includes/fix.h, + includes/gr.h, includes/grdef.h, includes/hash.h, + includes/ibitblt.h, includes/iff.h, includes/ipx.h, + includes/loadgl.h, includes/lst.bat, includes/m.bat, + includes/maths.h, includes/modex.h, includes/mono.h, + includes/ogl_init.h, includes/pa_enabl.h, includes/palette.h, + includes/pcx.h, includes/psmacros.inc, includes/pstypes.h, + includes/pstypes.inc, includes/rle.h, includes/strio.h, + includes/strutil.h, includes/test.c, includes/test.lnk, + includes/texmap.h, includes/timer.h, includes/u_dpmi.h, + includes/u_mem.h, includes/vecmat.h, includes/vesa.h, + sound/Makefile.am, sound/Makefile.in, sound/sdl_cdrom.c, + sound/sdl_digi.c, texmap/Makefile.am, texmap/Makefile.in, + texmap/ntmap.c, texmap/scanline.c, texmap/scanline.h, + texmap/texmapl.h, texmap/tmap_flt.asm, texmap/tmap_inc.asm, + texmap/tmap_lin.asm, texmap/tmap_ll.asm, texmap/tmap_per.asm, + texmap/tmapfade.asm, texmap/tmapflat.c, texmap/tmappent.S, + texmap/tmapppro.S: Import of d2x-0.0.8 + diff --git a/INSTALL b/INSTALL index c69d049c..27185a7c 100644 --- a/INSTALL +++ b/INSTALL @@ -1,6 +1,9 @@ Firstly, compile d2x. -Then stick it in a directory with these files from a Descent 2 Registered installation (the version _does not_ matter). Shareware may work if you hack at the shareware build system, but I haven't even attempted it. +Then stick it in a directory with these files from a Descent 2 +Registered Installation (the version _does not_ matter). Shareware may +work if you hack at the shareware build system, but I haven't even +attempted it. I needed these files: (in addition to the d2x binary) alien1.pig diff --git a/Makefile.am b/Makefile.am index e707d25c..c7464d4a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,19 @@ -SUBDIRS = 2d 3d maths mem cfile iff texmap misc input video sound arch main +SUBDIRS = 2d 3d maths mem cfile iff texmap misc input video sound arch main \ +includes tools unused + +changelog:: + -touch ChangeLog + -tools/cvs2cl/cvs2cl.pl -b --utc + -rm -f ChangeLog.bak ## to automatically rebuild aclocal.m4 if any of the macros in ## `macros/' change -@MAINT@include macros/macros.dep -@MAINT@macros/macros.dep: macros/Makefile.am -@MAINT@ cd macros && $(MAKE) macros.dep +#@MAINT@include macros/macros.dep +#@MAINT@macros/macros.dep: macros/Makefile.am +#@MAINT@ cd macros && $(MAKE) macros.dep + +EXTRA_DIST = \ +ChangeLog \ +djgpp.bat djgpp.sh \ +autogen.sh cygconf \ +cvshowto.txt readme.txt license.txt thinking.txt diff --git a/Makefile.in b/Makefile.in deleted file mode 100644 index be3ba77c..00000000 --- a/Makefile.in +++ /dev/null @@ -1,363 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# 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. - -# 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. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = . - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CFLAGS = @CFLAGS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NASM = @NASM@ -NASMFLAGS = @NASMFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -SDL_LIBS = @SDL_LIBS@ -VERSION = @VERSION@ - -SUBDIRS = 2d 3d maths mem cfile iff texmap misc input video sound arch main -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = conf.h -CONFIG_CLEAN_FILES = -DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \ -Makefile.am Makefile.in NEWS aclocal.m4 conf.h.in config.guess \ -config.sub configure configure.in install-sh ltconfig ltmain.sh missing \ -mkinstalldirs - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -all: all-redirect -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ 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): @MAINTAINER_MODE_TRUE@ configure.in - cd $(srcdir) && $(ACLOCAL) - -config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck -$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) - cd $(srcdir) && $(AUTOCONF) - -conf.h: stamp-h - @if test ! -f $@; then \ - rm -f stamp-h; \ - $(MAKE) stamp-h; \ - else :; fi -stamp-h: $(srcdir)/conf.h.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES= CONFIG_HEADERS=conf.h \ - $(SHELL) ./config.status - @echo timestamp > stamp-h 2> /dev/null -$(srcdir)/conf.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in - @if test ! -f $@; then \ - rm -f $(srcdir)/stamp-h.in; \ - $(MAKE) $(srcdir)/stamp-h.in; \ - else :; fi -$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOHEADER) - @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null - -mostlyclean-hdr: - -clean-hdr: - -distclean-hdr: - -rm -f conf.h - -maintainer-clean-hdr: - -# 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. - -@SET_MAKE@ - -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) conf.h.in $(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)conf.h.in$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags conf.h.in $$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 - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$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 -info-am: -info: info-recursive -dvi-am: -dvi: dvi-recursive -check-am: all-am -check: check-recursive -installcheck-am: -installcheck: installcheck-recursive -all-recursive-am: conf.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -install-exec-am: -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: uninstall-recursive -all-am: Makefile conf.h -all-redirect: all-recursive-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: installdirs-recursive -installdirs-am: - - -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-hdr mostlyclean-tags mostlyclean-generic - -mostlyclean: mostlyclean-recursive - -clean-am: clean-hdr clean-tags clean-generic mostlyclean-am - -clean: clean-recursive - -distclean-am: distclean-hdr distclean-tags distclean-generic clean-am - -distclean: distclean-recursive - -rm -f config.status - -maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \ - 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-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ -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 info-am info \ -dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \ -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 - - -@MAINT@include macros/macros.dep -@MAINT@macros/macros.dep: macros/Makefile.am -@MAINT@ cd macros && $(MAKE) macros.dep - -# 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/NEWS b/NEWS index e69de29b..08bcb424 100644 --- a/NEWS +++ b/NEWS @@ -0,0 +1,28 @@ +--- Version 0.0.9 --- +Improved automake setup, 'make dist' and VPATH builds now work. +svgalib, ggi support (alpha) +Merged in joystick support from Michael.Wagener@materna.de +Added -grabmouse option to keep the mouse from wandering away in +windowed SDL. Pressing pause ungrabs it. +--- Version 0.0.8 --- +Added -nocdrom option, fixed cdrom code. +Made various error messages more helpful. +Big code cleanup - removed lots and lots of warnings. Still plenty left, but most are gone. +Kludge to allow the game to work with v1.0 datafiles. +Workaround for odd gcc bug (possible). +Fixed mission and demo loading. +Fixed nonetwork build. +Removed libtool dependancy. (Thanks to Falk Hueffner for pointing this out) +--- Version 0.0.7 --- +Added beginnings of console. (main/console.c main/cmd.c) +Added -debug command line option to show debug information. +Fixed -nosound option. +Changed malloc, calloc, free -> d_malloc, d_calloc and d_free to prevent ugly clashes between the real and the wrapped system calls. Added d_strdup +Removed dos linefeeds from the source files +Fixed palette problems with flat shaded polygons. + +Issues currently under investigation: +* Weird crash reported by Robert Linden - as yet unreproducable +--- Version 0.0.6 --- +Initial ChangeLog entry +No change from v0.0.5 except Makefile/config system cleanup. diff --git a/README b/README index 73c52cc6..4a88aa4d 100644 --- a/README +++ b/README @@ -2,13 +2,16 @@ D2X =========== +http://shelob.classrooms.washington.edu/d2x +(anybody with a cooler domain want to host? or CNAME it?) Linux: ====== Required tools: * GCC 2.95 -* SDL 1.0 (get it from http://www.devolution.com/~slouken/projects/SDL/) +* SDL 1.0 or higher + (get it from http://www.devolution.com/~slouken/projects/SDL/) * NASM 0.98 (OPTIONAL but RECOMMENDED, not sure, try your linux distribution) * A thread safe X server. * Make, sed, etc... @@ -20,7 +23,7 @@ Install all of the components above. Next, from the d2x directory: ./configure (./configure --help will show you the available options) For OpenGL support, try configuring with --with-opengl. Your mileage may vary -(but basically, you need an accelerated Mesa sitting somewhere where d2x cab +(but basically, you need an accelerated Mesa sitting somewhere where d2x can see it)... The OpenGL support isn't perfect, but it works... make @@ -33,9 +36,11 @@ Known bugs/issues: * Serial support doesn't work. (UDP and IPX networking does) * Movies (unlikely ever to be supported) * Sound glitches (due to stuff I haven't implemented) -* The mouse support is at the same level as it was in d1x (as in, it kind of works) +* The mouse support is at the same level as it was in d1x (as in, it + kind of works) * Something went screwy with the control config system, it kinda got "d1xed"... -* OpenGL leaks memory like it is going out of fashion. It leaked about 64meg in a few minutes for me. I need to debug this =) +* OpenGL leaks memory like it is going out of fashion. It leaked about + 64meg in a few minutes for me. I need to debug this =) MS-DOS: @@ -77,10 +82,15 @@ Reporting bugs/feedback: ======================== There are two ways to report bugs and give feedback: -1) Get on the descent-source mailing list by sending an email to majordomo@warpcore.org with the body as: "subscribe descent-source ". Discussions about the source code in general are available here, and is the main list that d2x and d1x, a similar project for descent 1 is discussed on. Patches and questions can be posted there, as well. - -2) Send feedback directly to me, peterhawkins@ozemail.com.au. I'll try to get back to you ASAP, depending on real-life concerns =) - +1) Get on the descent-source mailing list by sending an email to +majordomo@warpcore.org with the body as: "subscribe descent-source +". Discussions about the source code in general +are available here, and is the main list that d2x and d1x, a similar +project for descent 1 is discussed on. Patches and questions can be +posted there, as well. + +2) Send feedback directly to me, bradleyb@u.washington.edu. I'll try +to get back to you ASAP, depending on real-life concerns =) /* THE OLD README FOLLOWS */ Legal Stuff: diff --git a/acconfig.h b/acconfig.h new file mode 100644 index 00000000..ec853811 --- /dev/null +++ b/acconfig.h @@ -0,0 +1,53 @@ +/* Define if you want an assembler free build */ +#undef NO_ASM + +/* Define if you want a network build */ +#undef NETWORK + +/* Define if you want an OpenGL build */ +#undef OGL + +/* Define if you want an SVGALib build */ +#undef SVGA + +/* Define if you want a GGI build */ +#undef GGI + +/* Define if building under linux */ +#undef __ENV_LINUX__ + +/* Define if building under msdos */ +#undef __ENV_DJGPP__ + +/* Define to disable asserts, int3, etc. */ +#undef NDEBUG + +@BOTTOM@ + +/* General defines */ +#define NMONO 1 +#define PIGGY_USE_PAGING 1 +#define NEWDEMO 1 + +#ifdef __ENV_LINUX__ +# define __SDL__ 1 +# define SDL_AUDIO 1 + +# ifdef OGL +# define SDL_GL_VIDEO 1 +# define SDL_INPUT 1 +# else +# ifdef GGI +# define GGI_VIDEO 1 +# define GII_INPUT 1 +# else +# ifdef SVGA +# define SVGALIB_VIDEO 1 +# define SVGALIB_INPUT 1 +# else +# define SDL_VIDEO 1 +# define SDL_INPUT 1 +# endif +# endif +# endif +#endif diff --git a/aclocal.m4 b/aclocal.m4 index f71fe8a5..a60c657f 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -158,3 +158,195 @@ else $1_FALSE= fi]) +#serial 1 +# This test replaces the one in autoconf. +# Currently this macro should have the same name as the autoconf macro +# because gettext's gettext.m4 (distributed in the automake package) +# still uses it. Otherwise, the use in gettext.m4 makes autoheader +# give these diagnostics: +# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX +# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX + +undefine([AC_ISC_POSIX]) + +AC_DEFUN([AC_ISC_POSIX], + [ + dnl This test replaces the obsolescent AC_ISC_POSIX kludge. + AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) + ] +) + +# Configure paths for SDL +# Sam Lantinga 9/21/99 +# stolen from Manish Singh +# stolen back from Frank Belew +# stolen from Manish Singh +# Shamelessly stolen from Owen Taylor + +dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS +dnl +AC_DEFUN(AM_PATH_SDL, +[dnl +dnl Get the cflags and libraries from the sdl-config script +dnl +AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], + sdl_prefix="$withval", sdl_prefix="") +AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)], + sdl_exec_prefix="$withval", sdl_exec_prefix="") +AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program], + , enable_sdltest=yes) + + if test x$sdl_exec_prefix != x ; then + sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix" + if test x${SDL_CONFIG+set} != xset ; then + SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config + fi + fi + if test x$sdl_prefix != x ; then + sdl_args="$sdl_args --prefix=$sdl_prefix" + if test x${SDL_CONFIG+set} != xset ; then + SDL_CONFIG=$sdl_prefix/bin/sdl-config + fi + fi + + AC_PATH_PROG(SDL_CONFIG, sdl-config, no) + min_sdl_version=ifelse([$1], ,0.11.0,$1) + AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) + no_sdl="" + if test "$SDL_CONFIG" = "no" ; then + no_sdl=yes + else + SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags` + SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs` + + sdl_major_version=`$SDL_CONFIG $sdl_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_sdltest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" +dnl +dnl Now check if the installed SDL is sufficiently new. (Also sanity +dnl checks the results of sdl-config to some extent +dnl + rm -f conf.sdltest + AC_TRY_RUN([ +#include +#include +#include +#include "SDL.h" + +char* +my_strdup (char *str) +{ + char *new_str; + + if (str) + { + new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); + strcpy (new_str, str); + } + else + new_str = NULL; + + return new_str; +} + +int main (int argc, char *argv[]) +{ + int major, minor, micro; + char *tmp_version; + + /* This hangs on some systems (?) + system ("touch conf.sdltest"); + */ + { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); } + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_sdl_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_sdl_version"); + exit(1); + } + + if (($sdl_major_version > major) || + (($sdl_major_version == major) && ($sdl_minor_version > minor)) || + (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); + printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n"); + printf("*** to point to the correct copy of sdl-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + return 1; + } +} + +],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_sdl" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$SDL_CONFIG" = "no" ; then + echo "*** The sdl-config script installed by SDL could not be found" + echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the SDL_CONFIG environment variable to the" + echo "*** full path to sdl-config." + else + if test -f conf.sdltest ; then + : + else + echo "*** Could not run SDL test program, checking why..." + CFLAGS="$CFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" + AC_TRY_LINK([ +#include +#include "SDL.h" + +int main(int argc, char *argv[]) +{ return 0; } +#undef main +#define main K_and_R_C_main +], [ return 0; ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding SDL or finding the wrong" + echo "*** version of SDL. If it is not finding SDL, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means SDL was incorrectly installed" + echo "*** or that you have moved SDL since it was installed. In the latter case, you" + echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + SDL_CFLAGS="" + SDL_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(SDL_CFLAGS) + AC_SUBST(SDL_LIBS) + rm -f conf.sdltest +]) + diff --git a/arch/Makefile.am b/arch/Makefile.am index 8c4c8992..9ee9d599 100644 --- a/arch/Makefile.am +++ b/arch/Makefile.am @@ -1,20 +1,43 @@ +SUBDIRS = include dos linux win32 + noinst_LIBRARIES = libarch.a -INCLUDES = -I $(top_srcdir)/includes -I $(top_srcdir)/main +INCLUDES = -I$(top_srcdir)/includes -I$(top_srcdir)/main -I$(top_srcdir)/arch/include -libarch_a_SOURCES = \ -dos_init.c dos_vesa.c dos_findfile.c dos_dpmi.c dos_ipx.c \ -linux_init.c linux_findfile.c linux_net.c linux_ipx_bsd.c \ -linux_ipx_lin.c linux_ipx_udp.c \ -sdl_init.c sdl_timer.c +if ENV_DJGPP +libarch_a_SOURCES = dos_init.c dos_vesa.c dos_findfile.c dos_dpmi.c dos_ipx.c +else +if USE_NETWORK +if MINGW32 +libarch_a_SOURCES = linux_init.c win32_findfile.c sdl_init.c sdl_timer.c + linux_ipx_bsd.c linux_ipx_lin.c linux_ipx_udp.c linux_net.c +else +libarch_a_SOURCES = linux_init.c linux_findfile.c sdl_init.c sdl_timer.c \ + linux_ipx_bsd.c linux_ipx_lin.c linux_ipx_udp.c linux_net.c +endif +else +if MINGW32 +libarch_a_SOURCES = linux_init.c win32_findfile.c sdl_init.c sdl_timer.c +else +libarch_a_SOURCES = linux_init.c linux_findfile.c sdl_init.c sdl_timer.c +endif +endif +endif +EXTRA_libarch_a_SOURCES = \ + dos_init.c dos_vesa.c dos_findfile.c dos_dpmi.c dos_ipx.c \ + linux_init.c linux_findfile.c \ + linux_net.c linux_ipx_bsd.c linux_ipx_lin.c linux_ipx_udp.c \ + sdl_init.c sdl_timer.c \ + win32_findfile.c +SUFFIXES = .asm +%.o: %.asm + $(NASM) $(NASMFLAGS) $< -o $@ if ENV_DJGPP - SUFFIXES = .asm - %.o: %.asm - $(NASM) $(NASMFLAGS) $< -o $@ - - libarch_a_SOURCES += dos_timer.asm dos_modex.asm - libarch_a_LIBADD += dos_timer.o dos_modex.o - dos_init.c: dos_timer.o dos_modex.o +libarch_a_LIBADD += dos_timer.o dos_modex.o endif + +EXTRA_DIST = \ +dos_tweak.inc dos_vgaregs.inc \ +dos_modex.asm dos_timer.asm diff --git a/arch/Makefile.in b/arch/Makefile.in deleted file mode 100644 index 367b0023..00000000 --- a/arch/Makefile.in +++ /dev/null @@ -1,314 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# 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. - -# 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. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CFLAGS = @CFLAGS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NASM = @NASM@ -NASMFLAGS = @NASMFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -SDL_LIBS = @SDL_LIBS@ -VERSION = @VERSION@ - -noinst_LIBRARIES = libarch.a -INCLUDES = -I $(top_srcdir)/includes -I $(top_srcdir)/main - -libarch_a_SOURCES = dos_init.c dos_vesa.c dos_findfile.c dos_dpmi.c dos_ipx.c linux_init.c linux_findfile.c linux_net.c linux_ipx_bsd.c linux_ipx_lin.c linux_ipx_udp.c sdl_init.c sdl_timer.c - -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../conf.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I.. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -libarch_a_LIBADD = -libarch_a_OBJECTS = dos_init.o dos_vesa.o dos_findfile.o dos_dpmi.o \ -dos_ipx.o linux_init.o linux_findfile.o linux_net.o linux_ipx_bsd.o \ -linux_ipx_lin.o linux_ipx_udp.o sdl_init.o sdl_timer.o -AR = ar -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -DEP_FILES = .deps/dos_dpmi.P .deps/dos_findfile.P .deps/dos_init.P \ -.deps/dos_ipx.P .deps/dos_vesa.P .deps/linux_findfile.P \ -.deps/linux_init.P .deps/linux_ipx_bsd.P .deps/linux_ipx_lin.P \ -.deps/linux_ipx_udp.P .deps/linux_net.P .deps/sdl_init.P \ -.deps/sdl_timer.P -SOURCES = $(libarch_a_SOURCES) -OBJECTS = $(libarch_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu arch/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -.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: - -libarch.a: $(libarch_a_OBJECTS) $(libarch_a_DEPENDENCIES) - -rm -f libarch.a - $(AR) cru libarch.a $(libarch_a_OBJECTS) $(libarch_a_LIBADD) - $(RANLIB) libarch.a - -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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - 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 = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = arch - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu arch/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - 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 - @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 -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -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-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-depend mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - 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-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags 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 \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -@ENV_DJGPP_TRUE@ SUFFIXES = .asm -@ENV_DJGPP_TRUE@ %.o: %.asm -@ENV_DJGPP_TRUE@ $(NASM) $(NASMFLAGS) $< -o $@ - -@ENV_DJGPP_TRUE@ libarch_a_SOURCES += dos_timer.asm dos_modex.asm -@ENV_DJGPP_TRUE@ libarch_a_LIBADD += dos_timer.o dos_modex.o -@ENV_DJGPP_TRUE@ dos_init.c: dos_timer.o dos_modex.o - -# 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/arch/dos/Makefile.am b/arch/dos/Makefile.am index 80b046e4..a2d4309d 100644 --- a/arch/dos/Makefile.am +++ b/arch/dos/Makefile.am @@ -1,20 +1,5 @@ -if ENV_DJGPP +SUBDIRS = allg_snd bak comm include mm_snd -noinst_LIBRARIES = libarchdos.a -INCLUDES = -I $(top_srcdir)/includes -Iinclude -I $(top_srcdir)/main -I$(top_srcdir)/input/sdl/include - -libarchdos_a_SOURCES = init.c dpmi.c findfile.c vesa.c - - -if USE_ASM - SUFFIXES = .asm - %.o: %.asm - $(NASM) $(NASMFLAGS) $< -o $@ - - libarchdos_a_SOURCES += timer.asm modex.asm - libarchdos_a_LIBADD += timer.o modex.o - init.c: timer.o modex.o -endif - - -endif +EXTRA_DIST = \ +ipx.h mono.h \ +bcd.c digiallg.c digimm.c disk.c midiallg.c mono.c serial.c diff --git a/arch/dos/Makefile.in b/arch/dos/Makefile.in deleted file mode 100644 index 785002a9..00000000 --- a/arch/dos/Makefile.in +++ /dev/null @@ -1,307 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# 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. - -# 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. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = ../.. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CFLAGS = @CFLAGS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NASM = @NASM@ -NASMFLAGS = @NASMFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -SDL_LIBS = @SDL_LIBS@ -VERSION = @VERSION@ - -@ENV_DJGPP_TRUE@noinst_LIBRARIES = libarchdos.a -@ENV_DJGPP_TRUE@INCLUDES = -I $(top_srcdir)/includes -Iinclude -I $(top_srcdir)/main -I$(top_srcdir)/input/sdl/include - -@ENV_DJGPP_TRUE@libarchdos_a_SOURCES = init.c dpmi.c findfile.c vesa.c -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../../conf.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I../.. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -libarchdos_a_LIBADD = -@ENV_DJGPP_TRUE@libarchdos_a_OBJECTS = init.o dpmi.o findfile.o vesa.o -AR = ar -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -DEP_FILES = .deps/dpmi.P .deps/findfile.P .deps/init.P .deps/vesa.P -SOURCES = $(libarchdos_a_SOURCES) -OBJECTS = $(libarchdos_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu arch/dos/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -.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: - -libarchdos.a: $(libarchdos_a_OBJECTS) $(libarchdos_a_DEPENDENCIES) - -rm -f libarchdos.a - $(AR) cru libarchdos.a $(libarchdos_a_OBJECTS) $(libarchdos_a_LIBADD) - $(RANLIB) libarchdos.a - -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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - 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 = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = arch/dos - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu arch/dos/Makefile - @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 - -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 - @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 -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -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-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-depend mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - 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-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags 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 \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -@ENV_DJGPP_TRUE@@USE_ASM_TRUE@ SUFFIXES = .asm -@ENV_DJGPP_TRUE@@USE_ASM_TRUE@ %.o: %.asm -@ENV_DJGPP_TRUE@@USE_ASM_TRUE@ $(NASM) $(NASMFLAGS) $< -o $@ - -@ENV_DJGPP_TRUE@@USE_ASM_TRUE@ libarchdos_a_SOURCES += timer.asm modex.asm -@ENV_DJGPP_TRUE@@USE_ASM_TRUE@ libarchdos_a_LIBADD += timer.o modex.o -@ENV_DJGPP_TRUE@@USE_ASM_TRUE@ init.c: timer.o modex.o - -# 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/arch/dos/allg_snd/Makefile.am b/arch/dos/allg_snd/Makefile.am new file mode 100644 index 00000000..915f313a --- /dev/null +++ b/arch/dos/allg_snd/Makefile.am @@ -0,0 +1,5 @@ +SUBDIRS = sound + +EXTRA_DIST = \ +internal.h \ +allg_snd.c diff --git a/arch/dos/allg_snd/sound/Makefile.am b/arch/dos/allg_snd/sound/Makefile.am new file mode 100644 index 00000000..b5bd20e2 --- /dev/null +++ b/arch/dos/allg_snd/sound/Makefile.am @@ -0,0 +1,6 @@ +SUBDIRS = drv + +EXTRA_DIST = \ +readme.d1 readme.txt \ +allegro.h interndj.h \ +config.c digmid.c midi.c mixer.c snddrv.c sound.c diff --git a/arch/dos/allg_snd/sound/drv/Makefile.am b/arch/dos/allg_snd/sound/drv/Makefile.am new file mode 100644 index 00000000..a84bde46 --- /dev/null +++ b/arch/dos/allg_snd/sound/drv/Makefile.am @@ -0,0 +1,3 @@ +EXTRA_DIST = \ +emu8k.h fm_instr.h \ +adlib.c awedata.c dma.c emu8k.c emu8kmid.c gus.c mpu.c sb.c diff --git a/arch/dos/bak/Makefile.am b/arch/dos/bak/Makefile.am new file mode 100644 index 00000000..56a9f620 --- /dev/null +++ b/arch/dos/bak/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ +ipx.c diff --git a/arch/dos/cdrom.c b/arch/dos/cdrom.c deleted file mode 100644 index 7d92839a..00000000 --- a/arch/dos/cdrom.c +++ /dev/null @@ -1,77 +0,0 @@ -/* DPH: This is the file where all the stub functions go. The aim is to have nothing in here ,eventually */ -#include -#include -#include -#include "pstypes.h" -#include "error.h" -#include "args.h" - - -extern int Redbook_playing; -static int initialised = 0; - -void RBAExit() -{ -} - -void RBAInit() -{ - -} - -int RBAEnabled() -{ - return 1; -} - -void RBARegisterCD() -{ - -} - -int RBAPlayTrack(int a) -{ -return 0; -} - -void RBAStop() -{ -} - -void RBASetVolume(int a) -{ - -} - -void RBAPause() -{ -} - -void RBAResume() -{ -} - -int RBAGetNumberOfTracks() -{ -return 0; -} - -int RBAPlayTracks(int tracknum,int something) -{ -return -1; -} - -int RBAGetTrackNum() -{ -return -1; -} - -int RBAPeekPlayStatus() -{ - return -1; -} - -int CD_blast_mixer() -{ - return 0; -} diff --git a/arch/dos/comm/Makefile.am b/arch/dos/comm/Makefile.am new file mode 100644 index 00000000..889e33a5 --- /dev/null +++ b/arch/dos/comm/Makefile.am @@ -0,0 +1,5 @@ +SUBDIRS = include + +EXTRA_DIST = \ +irqwrap.S \ +commlib.c dzcomm.c dzqueue.c irq.c diff --git a/arch/dos/comm/include/Makefile.am b/arch/dos/comm/include/Makefile.am new file mode 100644 index 00000000..3992b967 --- /dev/null +++ b/arch/dos/comm/include/Makefile.am @@ -0,0 +1,3 @@ +EXTRA_DIST = \ +asmdef.inc asmdefs.inc \ +allegro.h commlib.h internal.h diff --git a/arch/dos/digi.c b/arch/dos/digi.c deleted file mode 100644 index d224d970..00000000 --- a/arch/dos/digi.c +++ /dev/null @@ -1,810 +0,0 @@ -// SDL digital audio support - -#include -#include -#include -#include - -#include "pstypes.h" -#include "error.h" -#include "mono.h" -#include "fix.h" -#include "vecmat.h" -#include "gr.h" // needed for piggy.h -#include "piggy.h" -#include "digi.h" -#include "sounds.h" -#include "wall.h" -#include "newdemo.h" -#include "kconfig.h" - -int digi_sample_rate=11025; -int digi_timer_rate = 9943; // rate for the timer to go off to handle the driver system (120 Hz) - -//edited 05/17/99 Matt Mueller - added ifndef NO_ASM -//added on 980905 by adb to add inline fixmul for mixer on i386 -#ifndef NO_ASM -#ifdef __i386__ -#define do_fixmul(x,y) \ -({ \ - int _ax, _dx; \ - asm("imull %2\n\tshrdl %3,%1,%0" \ - : "=a"(_ax), "=d"(_dx) \ - : "rm"(y), "i"(16), "0"(x)); \ - _ax; \ -}) -extern inline fix fixmul(fix x, fix y) { return do_fixmul(x,y); } -#endif -#endif -//end edit by adb -//end edit -MM - -//changed on 980905 by adb to increase number of concurrent sounds -#define MAX_SOUND_SLOTS 32 -//end changes by adb -#define SOUND_BUFFER_SIZE 512 - -#define MIN_VOLUME 10 - -/* This table is used to add two sound values together and pin - * the value to avoid overflow. (used with permission from ARDI) - * DPH: Taken from SDL/src/SDL_mixer.c. - */ -static const unsigned char mix8[] = -{ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, - 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, - 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, - 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, - 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, - 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, - 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, - 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, - 0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, - 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, - 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, - 0x7D, 0x7E, 0x7F, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, - 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, - 0x9E, 0x9F, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, - 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, - 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, - 0xBF, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, - 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, - 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, - 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, - 0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, - 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -}; - -#define SOF_USED 1 // Set if this sample is used -#define SOF_PLAYING 2 // Set if this sample is playing on a channel -#define SOF_LINK_TO_OBJ 4 // Sound is linked to a moving object. If object dies, then finishes play and quits. -#define SOF_LINK_TO_POS 8 // Sound is linked to segment, pos -#define SOF_PLAY_FOREVER 16 // Play forever (or until level is stopped), otherwise plays once - -typedef struct sound_object { - short signature; // A unique signature to this sound - ubyte flags; // Used to tell if this slot is used and/or currently playing, and how long. - fix max_volume; // Max volume that this sound is playing at - fix max_distance; // The max distance that this sound can be heard at... - int volume; // Volume that this sound is playing at - int pan; // Pan value that this sound is playing at - int handle; // What handle this sound is playing on. Valid only if SOF_PLAYING is set. - short soundnum; // The sound number that is playing - union { - struct { - short segnum; // Used if SOF_LINK_TO_POS field is used - short sidenum; - vms_vector position; - }pos; - struct { - short objnum; // Used if SOF_LINK_TO_OBJ field is used - short objsignature; - }obj; - }link; -} sound_object; -#define lp_segnum link.pos.segnum -#define lp_sidenum link.pos.sidenum -#define lp_position link.pos.position - -#define lo_objnum link.obj.objnum -#define lo_objsignature link.obj.objsignature - -#define MAX_SOUND_OBJECTS 16 -sound_object SoundObjects[MAX_SOUND_OBJECTS]; -short next_signature=0; - -//added/changed on 980905 by adb to make sfx volume work, on 990221 by adb changed F1_0 to F1_0 / 2 -#define SOUND_MAX_VOLUME (F1_0 / 2) - -int digi_volume = SOUND_MAX_VOLUME; -//end edit by adb - -int digi_lomem = 0; - -static int digi_initialised = 0; - -struct sound_slot { - int soundno; - int playing; // Is there a sample playing on this channel? - int looped; // Play this sample looped? - fix pan; // 0 = far left, 1 = far right - fix volume; // 0 = nothing, 1 = fully on - //changed on 980905 by adb from char * to unsigned char * - unsigned char *samples; - //end changes by adb - unsigned int length; // Length of the sample - unsigned int position; // Position we are at at the moment. -} SoundSlots[MAX_SOUND_SLOTS]; - -static int digi_sounds_initialized = 0; - -//added on 980905 by adb to add rotating/volume based sound kill system -static int digi_max_channels = 16; -static int next_handle = 0; -int SampleHandles[32]; -void reset_sounds_on_channel(int channel); -//end edit by adb - -void digi_reset_digi_sounds(void); - -/* Audio mixing callback */ -//changed on 980905 by adb to cleanup, add pan support and optimize mixer -static void audio_mixcallback(void *userdata, unsigned char *stream, int len) -{ - unsigned char *streamend = stream + len; - struct sound_slot *sl; - - for (sl = SoundSlots; sl < SoundSlots + MAX_SOUND_SLOTS; sl++) - { - if (sl->playing) - { - unsigned char *sldata = sl->samples + sl->position, *slend = sl->samples + sl->length; - unsigned char *sp = stream; - signed char v; - fix vl, vr; - int x; - - if ((x = sl->pan) & 0x8000) - { - vl = 0x20000 - x * 2; - vr = 0x10000; - } - else - { - vl = 0x10000; - vr = x * 2; - } - vl = fixmul(vl, (x = sl->volume)); - vr = fixmul(vr, x); - while (sp < streamend) - { - if (sldata == slend) - { - if (!sl->looped) - { - sl->playing = 0; - break; - } - sldata = sl->samples; - } - v = *(sldata++) - 0x80; - *(sp++) = mix8[ *sp + fixmul(v, vl) + 0x80 ]; - *(sp++) = mix8[ *sp + fixmul(v, vr) + 0x80 ]; - } - sl->position = sldata - sl->samples; - } - } -} -//end changes by adb - -/* Initialise audio devices. */ -int digi_init() -{ - - return 1; -} - -/* Toggle audio */ -void digi_reset() { } - -/* Shut down audio */ -void digi_close() -{ - if (!digi_initialised) return; - digi_initialised = 0; -} - -/* Find the sound which actually equates to a sound number */ -int digi_xlat_sound(int soundno) -{ - if ( soundno < 0 ) return -1; - - if ( digi_lomem ) { - soundno = AltSounds[soundno]; - if ( soundno == 255 ) return -1; - } - return Sounds[soundno]; -} - -static int get_free_slot() -{ - int i; - for (i=0; i= 0) && (SoundSlots[SampleHandles[next_handle]].playing) ) - { - if ( (SoundSlots[SampleHandles[next_handle]].volume > digi_volume) && (ntries= digi_max_channels ) - next_handle = 0; - ntries++; - goto TryNextChannel; - } - //mprintf(( 0, "[SS:%d]", next_handle )); - SoundSlots[SampleHandles[next_handle]].playing = 0; - SampleHandles[next_handle] = -1; - } - //end edit by adb - - slot = get_free_slot(); - if (slot<0) return -1; - - SoundSlots[slot].soundno = soundnum; - SoundSlots[slot].samples = GameSounds[soundnum].data; - SoundSlots[slot].length = GameSounds[soundnum].length; - SoundSlots[slot].volume = fixmul(digi_volume, volume); - SoundSlots[slot].pan = pan; - SoundSlots[slot].position = 0; - SoundSlots[slot].looped = 0; - SoundSlots[slot].playing = 1; - - //added on 980905 by adb to add sound kill system from original sos digi.c - reset_sounds_on_channel(slot); - SampleHandles[next_handle] = slot; - next_handle++; - if ( next_handle >= digi_max_channels ) - next_handle = 0; - //end edit by adb - - return slot; -} - - //added on 980905 by adb to add sound kill system from original sos digi.c -void reset_sounds_on_channel( int channel ) -{ - int i; - - for (i=0; i -1 ) { - *volume = max_volume - fixdiv(path_distance,max_distance); - //mprintf( (0, "Sound path distance %.2f, volume is %d / %d\n", f2fl(distance), *volume, max_volume )); - if (*volume > 0 ) { - angle_from_ear = vm_vec_delta_ang_norm(&listener->rvec,&vector_to_sound,&listener->uvec); - fix_sincos(angle_from_ear,&sinang,&cosang); - //mprintf( (0, "volume is %.2f\n", f2fl(*volume) )); - if (Config_channels_reversed) cosang *= -1; - *pan = (cosang + F1_0)/2; - } else { - *volume = 0; - } - } - } -} - -int digi_link_sound_to_object2( int org_soundnum, short objnum, int forever, fix max_volume, fix max_distance ) -{ - int i,volume,pan; - object * objp; - int soundnum; - - soundnum = digi_xlat_sound(org_soundnum); - - if ( max_volume < 0 ) return -1; -// if ( max_volume > F1_0 ) max_volume = F1_0; - - if (!digi_initialised) return -1; - if (soundnum < 0 ) return -1; - if (GameSounds[soundnum].data==NULL) { - Int3(); - return -1; - } - if ((objnum<0)||(objnum>Highest_object_index)) - return -1; - - if ( !forever ) { - // Hack to keep sounds from building up... - digi_get_sound_loc( &Viewer->orient, &Viewer->pos, Viewer->segnum, &Objects[objnum].pos, Objects[objnum].segnum, max_volume,&volume, &pan, max_distance ); - digi_play_sample_3d( org_soundnum, pan, volume, 0 ); - return -1; - } - - for (i=0; iorient, &Viewer->pos, Viewer->segnum, - &objp->pos, objp->segnum, SoundObjects[i].max_volume, - &SoundObjects[i].volume, &SoundObjects[i].pan, SoundObjects[i].max_distance ); - - if (!forever || SoundObjects[i].volume >= MIN_VOLUME) - digi_start_sound_object(i); - - return SoundObjects[i].signature; -} - -int digi_link_sound_to_object( int soundnum, short objnum, int forever, fix max_volume ) -{ return digi_link_sound_to_object2( soundnum, objnum, forever, max_volume, 256*F1_0); } - -int digi_link_sound_to_pos2( int org_soundnum, short segnum, short sidenum, vms_vector * pos, int forever, fix max_volume, fix max_distance ) -{ - int i, volume, pan; - int soundnum; - - soundnum = digi_xlat_sound(org_soundnum); - - if ( max_volume < 0 ) return -1; -// if ( max_volume > F1_0 ) max_volume = F1_0; - - if (!digi_initialised) return -1; - if (soundnum < 0 ) return -1; - if (GameSounds[soundnum].data==NULL) { - Int3(); - return -1; - } - - if ((segnum<0)||(segnum>Highest_segment_index)) - return -1; - - if ( !forever ) { - // Hack to keep sounds from building up... - digi_get_sound_loc( &Viewer->orient, &Viewer->pos, Viewer->segnum, pos, segnum, max_volume, &volume, &pan, max_distance ); - digi_play_sample_3d( org_soundnum, pan, volume, 0 ); - return -1; - } - - for (i=0; iorient, &Viewer->pos, Viewer->segnum, - &SoundObjects[i].lp_position, SoundObjects[i].lp_segnum, - SoundObjects[i].max_volume, - &SoundObjects[i].volume, &SoundObjects[i].pan, SoundObjects[i].max_distance ); - - if (!forever || SoundObjects[i].volume >= MIN_VOLUME) - digi_start_sound_object(i); - - return SoundObjects[i].signature; -} - -int digi_link_sound_to_pos( int soundnum, short segnum, short sidenum, vms_vector * pos, int forever, fix max_volume ) -{ - return digi_link_sound_to_pos2( soundnum, segnum, sidenum, pos, forever, max_volume, F1_0 * 256 ); -} - -void digi_kill_sound_linked_to_segment( int segnum, int sidenum, int soundnum ) -{ - int i,killed; - - soundnum = digi_xlat_sound(soundnum); - - if (!digi_initialised) return; - - killed = 0; - - for (i=0; i 1 ) { - mprintf( (1, "ERROR: More than 1 sounds were deleted from seg %d\n", segnum )); - } -} - -void digi_kill_sound_linked_to_object( int objnum ) -{ - int i,killed; - - if (!digi_initialised) return; - - killed = 0; - - for (i=0; i 1 ) { - mprintf( (1, "ERROR: More than 1 sounds were deleted from object %d\n", objnum )); - } -} - -void digi_sync_sounds() -{ - int i; - int oldvolume, oldpan; - - if (!digi_initialised) return; - - for (i=0; iorient, &Viewer->pos, Viewer->segnum, - &SoundObjects[i].lp_position, SoundObjects[i].lp_segnum, - SoundObjects[i].max_volume, - &SoundObjects[i].volume, &SoundObjects[i].pan, SoundObjects[i].max_distance ); - - } else if ( SoundObjects[i].flags & SOF_LINK_TO_OBJ ) { - object * objp; - - objp = &Objects[SoundObjects[i].lo_objnum]; - - if ((objp->type==OBJ_NONE) || (objp->signature!=SoundObjects[i].lo_objsignature)) { - // The object that this is linked to is dead, so just end this sound if it is looping. - if ( (SoundObjects[i].flags & SOF_PLAYING) && (SoundObjects[i].flags & SOF_PLAY_FOREVER)) { - SoundSlots[SoundObjects[i].handle].playing = 0; - } - SoundObjects[i].flags = 0; // Mark as dead, so some other sound can use this sound - continue; // Go on to next sound... - } else { - digi_get_sound_loc( &Viewer->orient, &Viewer->pos, Viewer->segnum, - &objp->pos, objp->segnum, SoundObjects[i].max_volume, - &SoundObjects[i].volume, &SoundObjects[i].pan, SoundObjects[i].max_distance ); - } - } - - if (oldvolume != SoundObjects[i].volume) { - if ( SoundObjects[i].volume < MIN_VOLUME ) { - // Sound is too far away, so stop it from playing. - if ((SoundObjects[i].flags & SOF_PLAYING)&&(SoundObjects[i].flags & SOF_PLAY_FOREVER)) { - SoundSlots[SoundObjects[i].handle].playing = 0; - SoundObjects[i].flags &= ~SOF_PLAYING; // Mark sound as not playing - } - } else { - if (!(SoundObjects[i].flags & SOF_PLAYING)) { - digi_start_sound_object(i); - } else { - SoundSlots[SoundObjects[i].handle].volume = fixmuldiv(SoundObjects[i].volume,digi_volume,F1_0); - } - } - } - - if (oldpan != SoundObjects[i].pan) { - if (SoundObjects[i].flags & SOF_PLAYING) - SoundSlots[SoundObjects[i].handle].pan = SoundObjects[i].pan; - } - } - } -} - -void digi_init_sounds() -{ - int i; - - if (!digi_initialised) return; - - digi_reset_digi_sounds(); - - for (i=0; i SOUND_MAX_VOLUME ) - digi_volume = SOUND_MAX_VOLUME; - else if ( dvolume < 0 ) - digi_volume = 0; - else - digi_volume = dvolume; - - if ( !digi_initialised ) return; - - digi_sync_sounds(); -} -//end edit by adb - -void digi_set_volume( int dvolume, int mvolume ) { } - -int digi_is_sound_playing(int soundno) -{ - int i; - - soundno = digi_xlat_sound(soundno); - - for (i = 0; i < MAX_SOUND_SLOTS; i++) - //changed on 980905 by adb: added SoundSlots[i].playing && - if (SoundSlots[i].playing && SoundSlots[i].soundno == soundno) - //end changes by adb - return 1; - return 0; -} - - -void digi_pause_all() { } -void digi_resume_all() { } -void digi_stop_all() { } - - //added on 980905 by adb to make sound channel setting work -void digi_set_max_channels(int n) { - digi_max_channels = n; - - if ( digi_max_channels < 1 ) - digi_max_channels = 1; - if ( digi_max_channels > (MAX_SOUND_SLOTS-MAX_SOUND_OBJECTS) ) - digi_max_channels = (MAX_SOUND_SLOTS-MAX_SOUND_OBJECTS); - - if ( !digi_initialised ) return; - - digi_reset_digi_sounds(); -} - -int digi_get_max_channels() { - return digi_max_channels; -} -// end edit by adb - -void digi_reset_digi_sounds() { - int i; - - for (i=0; i< MAX_SOUND_SLOTS; i++) - SoundSlots[i].playing=0; - - //added on 980905 by adb to reset sound kill system - memset(SampleHandles, 255, sizeof(SampleHandles)); - next_handle = 0; - //end edit by adb -} - - -// MIDI stuff follows. -//added/killed on 11/25/98 by Matthew Mueller -//void digi_set_midi_volume( int mvolume ) { } -//void digi_play_midi_song( char * filename, char * melodic_bank, char * drum_bank, int loop ) {} -//void digi_stop_current_song() -//{ -//#ifdef HMIPLAY -// char buf[10]; -// -// sprintf(buf,"s"); -// send_ipc(buf); -//#endif -//} -//end this section kill - MM diff --git a/arch/dos/dosgr.c b/arch/dos/dosgr.c deleted file mode 100644 index 24724d68..00000000 --- a/arch/dos/dosgr.c +++ /dev/null @@ -1,724 +0,0 @@ -// Graphics functions for DOS. - -#include - -#include -#include -#include -#include -#include -#include "gr.h" -#include "grdef.h" -#include "palette.h" -#include "maths.h" -#include "u_mem.h" -#include "u_dpmi.h" -#include "vesa.h" -#include "modex.h" -#include "error.h" - -#ifdef __DJGPP__ -#include -#endif - -static int last_r=0, last_g=0, last_b=0; - -/* old gr.c stuff */ -unsigned char * gr_video_memory = (unsigned char *)0xa0000; - -char gr_pal_default[768]; - -int gr_installed = 0; - -volatile ubyte * pVideoMode = (volatile ubyte *)0x449; -volatile ushort * pNumColumns = (volatile ushort *)0x44a; -volatile ubyte * pNumRows = (volatile ubyte *)0x484; -volatile ushort * pCharHeight = (volatile ushort *)0x485; -volatile ushort * pCursorPos = (volatile ushort *)0x450; -volatile ushort * pCursorType = (volatile ushort *)0x460; -volatile ushort * pTextMemory = (volatile ushort *)0xb8000; - -typedef struct screen_save { - ubyte video_mode; - ubyte is_graphics; - ushort char_height; - ubyte width; - ubyte height; - ubyte cursor_x, cursor_y; - ubyte cursor_sline, cursor_eline; - ushort * video_memory; -} screen_save; - -screen_save gr_saved_screen; - -int gr_show_screen_info = 0; -extern int VGA_current_mode; - -void gr_set_cellheight( ubyte height ) -{ - ubyte temp; - - outp( 0x3d4, 9 ); - temp = inp( 0x3d5 ); - temp &= 0xE0; - temp |= height; - outp( 0x3d5, temp ); -} - -void gr_set_linear() -{ - outpw( 0x3c4, 0xE04 ); // enable chain4 mode - outpw( 0x3d4, 0x4014 ); // turn on dword mode - outpw( 0x3d4, 0xa317 ); // turn off byte mode -} - -void gr_16_to_256() -{ - outpw( 0x3ce, 0x4005 ); // set Shift reg to 1 - - inp( 0x3da ); // dummy input - - outp( 0x3c0, 0x30 ); - outp( 0x3c0, 0x61 ); // turns on PCS & PCC - - inp( 0x3da ); // dummy input - - outp( 0x3c0, 0x33 ); - outp( 0x3c0, 0 ); -} - -void gr_turn_screen_off() -{ - ubyte temp; - temp = inp( 0x3da ); - outp( 0x3c0, 0 ); -} - -void gr_turn_screen_on() -{ - ubyte temp; - temp = inp( 0x3da ); - outp( 0x3c0, 0x20 ); -} - -void gr_set_misc_mode( uint mode ) -{ - union REGS regs; - - memset( ®s, 0, sizeof(regs) ); - regs.w.ax = mode; - int386( 0x10, ®s, ®s ); - -} - -void gr_set_3dbios_mode( uint mode ) -{ - union REGS regs; - memset( ®s, 0, sizeof(regs) ); - regs.w.ax = 0x4fd0; - regs.w.bx = 0x3d00 | (mode & 0xff); - int386( 0x10, ®s, ®s ); -} - - - -void gr_set_text_25() -{ - union REGS regs; - - regs.w.ax = 3; - int386( 0x10, ®s, ®s ); - -} - -void gr_set_text_43() -{ - union REGS regs; - - regs.w.ax = 0x1201; - regs.w.bx = 0x30; - int386( 0x10, ®s, ®s ); - - regs.w.ax = 3; - int386( 0x10, ®s, ®s ); - - regs.w.ax = 0x1112; - regs.w.bx = 0x0; - int386( 0x10, ®s, ®s ); -} - -void gr_set_text_50() -{ - union REGS regs; - - regs.w.ax = 0x1202; - regs.w.bx = 0x30; - int386( 0x10, ®s, ®s ); - - regs.w.ax = 3; - int386( 0x10, ®s, ®s ); - - regs.w.ax = 0x1112; - regs.w.bx = 0x0; - int386( 0x10, ®s, ®s ); -} - -ubyte is_graphics_mode() -{ - byte tmp; - tmp = inp( 0x3DA ); // Reset flip-flip - outp( 0x3C0, 0x30 ); // Select attr register 10 - tmp = inp( 0x3C1 ); // Get graphics/text bit - return tmp & 1; -} - -void gr_setcursor(ubyte x, ubyte y, ubyte sline, ubyte eline) -{ - union REGS regs; - - memset( ®s, 0, sizeof(regs) ); - regs.w.ax = 0x0200; - regs.w.bx = 0; - regs.h.dh = y; - regs.h.dl = x; - int386( 0x10, ®s, ®s ); - - memset( ®s, 0, sizeof(regs) ); - regs.w.ax = 0x0100; - regs.h.ch = sline & 0xf; - regs.h.cl = eline & 0xf; - int386( 0x10, ®s, ®s ); -} - -void gr_getcursor(ubyte *x, ubyte *y, ubyte * sline, ubyte * eline) -{ - union REGS regs; - - memset( ®s, 0, sizeof(regs) ); - regs.w.ax = 0x0300; - regs.w.bx = 0; - int386( 0x10, ®s, ®s ); - *y = regs.h.dh; - *x = regs.h.dl; - *sline = regs.h.ch; - *eline = regs.h.cl; -} - - -int gr_save_mode() -{ - int i; - - gr_saved_screen.is_graphics = is_graphics_mode(); - gr_saved_screen.video_mode = *pVideoMode; - - if (!gr_saved_screen.is_graphics) { - gr_saved_screen.width = *pNumColumns; - gr_saved_screen.height = *pNumRows+1; - gr_saved_screen.char_height = *pCharHeight; - gr_getcursor(&gr_saved_screen.cursor_x, &gr_saved_screen.cursor_y, &gr_saved_screen.cursor_sline, &gr_saved_screen.cursor_eline ); - MALLOC(gr_saved_screen.video_memory,ushort, gr_saved_screen.width*gr_saved_screen.height ); - for (i=0; i < gr_saved_screen.width*gr_saved_screen.height; i++ ) - gr_saved_screen.video_memory[i] = pTextMemory[i]; - } - - if (gr_show_screen_info ) { - printf( "Current video mode 0x%x:\n", gr_saved_screen.video_mode ); - if (gr_saved_screen.is_graphics) - printf( "Graphics mode\n" ); - else { - printf( "Text mode\n" ); - printf( "( %d columns by %d rows)\n", gr_saved_screen.width, gr_saved_screen.height ); - printf( "Char height is %d pixel rows\n", gr_saved_screen.char_height ); - printf( "Cursor of type 0x%x,0x%x is at (%d, %d)\n", gr_saved_screen.cursor_sline, gr_saved_screen.cursor_eline,gr_saved_screen.cursor_x, gr_saved_screen.cursor_y ); - } - } - - return 0; -} - -int isvga() -{ - union REGS regs; - - memset( ®s, 0, sizeof(regs) ); - regs.w.ax = 0x1a00; - int386( 0x10, ®s, ®s ); - - if ( regs.h.al == 0x1a ) - return 1; - - return 0; -} - -void gr_restore_mode() -{ - int i; - - //gr_set_text_25(); - -#ifndef NOGRAPH - gr_palette_fade_out( gr_palette, 32, 0 ); - gr_palette_set_gamma(0); - if ( gr_saved_screen.video_mode == 3 ) { - switch( gr_saved_screen.height ) { - case 43: gr_set_text_43(); break; - case 50: gr_set_text_50(); break; - default: gr_set_text_25(); break; - } - } else { - gr_set_misc_mode(gr_saved_screen.video_mode); - } - if (gr_saved_screen.is_graphics==0) { - gr_sync_display(); - gr_sync_display(); - gr_palette_read( gr_pal_default ); - gr_palette_clear(); - for (i=0; i < gr_saved_screen.width*gr_saved_screen.height; i++ ) - pTextMemory[i]=gr_saved_screen.video_memory[i]; - gr_setcursor( gr_saved_screen.cursor_x, gr_saved_screen.cursor_y, gr_saved_screen.cursor_sline, gr_saved_screen.cursor_eline ); - gr_palette_faded_out = 1; - gr_palette_fade_in( gr_pal_default, 32, 0 ); - } -#endif - -} - -void gr_close() -{ - if (gr_installed==1) - { - gr_installed = 0; - gr_restore_mode(); - free(grd_curscreen); - if( gr_saved_screen.video_memory ) { - free(gr_saved_screen.video_memory); - gr_saved_screen.video_memory = NULL; - } - } -} - -#ifndef __DJGPP__ -int gr_vesa_setmode( int mode ) -{ - int retcode; - - retcode=gr_vesa_checkmode( mode ); - if ( retcode ) return retcode; - - return gr_vesa_setmodea( mode ); -} -#endif - - -int gr_set_mode(u_int32_t mode) -{ - int retcode; - unsigned int w,h,t,data, r; - - //JOHNgr_disable_default_palette_loading(); -#ifdef NOGRAPH -return 0; -#endif - switch(mode) - { - case SM_ORIGINAL: - return 0; - case SM(320,200)://0: - if (!isvga()) return 1; - gr_set_misc_mode(0x13); - w = 320; r = 320; h = 200; t=BM_LINEAR; data = (int)gr_video_memory; - break; - case SM(640,400)://SM_640x400V: - retcode = gr_vesa_setmode( 0x100 ); - if (retcode !=0 ) return retcode; - w = 640; r = 640; h = 400; t=BM_SVGA; data = 0; - break; - case SM(640,480)://SM_640x480V: - retcode = gr_vesa_setmode( 0x101 ); - if (retcode !=0 ) return retcode; - w = 640; r = 640; h = 480; t=BM_SVGA; data = 0; - break; - case SM(800,600)://SM_800x600V: - retcode = gr_vesa_setmode( 0x103 ); - if (retcode !=0 ) return retcode; - w = 800; r = 800; h = 600; t=BM_SVGA; data = 0; - break; - case SM(1024,768)://SM_1024x768V: - retcode = gr_vesa_setmode( 0x105 ); - if (retcode !=0 ) return retcode; - w = 1024; r = 1024; h = 768; t=BM_SVGA; data = 0; - break; -/* case SM_640x480V15: - retcode = gr_vesa_setmode( 0x110 ); - if (retcode !=0 ) return retcode; - w = 640; r = 640*2; h=480; t=BM_SVGA15; data = 0; - break; - case SM_800x600V15: - retcode = gr_vesa_setmode( 0x113 ); - if (retcode !=0 ) return retcode; - w = 800; r = 800*2; h=600; t=BM_SVGA15; data = 0; - break;*/ -// case 19: - case SM(320,100): - if (!isvga()) return 1; - gr_set_misc_mode(0x13); -// { -// ubyte x; -// x = inp( 0x3c5 ); -// x |= 8; -// outp( 0x3c5, x ); -// } - gr_set_cellheight( 3 ); - - w = 320; r = 320; h = 100; t=BM_LINEAR; data = (int)gr_video_memory; - break; -/* case 20: - retcode = gr_vesa_setmode( 0x102 ); - //gr_enable_default_palette_loading(); - if (retcode !=0 ) return retcode; - gr_16_to_256(); - gr_set_linear(); - //gr_set_cellheight( 1 ); - gr_vesa_setlogical( 400 ); - w = 400; r = 400; h = 600; t=BM_SVGA; data = 0; - break; - case 21: - if (!isvga()) return 1; - gr_set_misc_mode(0xd); - gr_16_to_256(); - gr_set_linear(); - gr_set_cellheight( 3 ); - w = 160; r = 160; h = 100; t=BM_LINEAR; data = (int)gr_video_memory; - break; - case //22: // 3dmax 320x400 - if (!isvga()) return 1; - gr_set_3dbios_mode(0x31); - //w = 320; r = 320/4; h = 400; t=BM_MODEX; data = 0; - w = 320; r = 320; h = 400; t=BM_SVGA; data = 0; - break;*/ - default: - if (!isvga()) return 1; - if (mode==SM(320,240)) - w = gr_modex_setmode( 2 ); - else if (mode==SM(320,400)) - w = gr_modex_setmode( 6 ); - else - Error("unhandled vid mode\n"); - //gr_enable_default_palette_loading(); - h = w & 0xffff; w = w >> 16; r = w / 4;t = BM_MODEX; data = 0; - break; - } - gr_palette_clear(); - - memset( grd_curscreen, 0, sizeof(grs_screen)); - grd_curscreen->sc_mode = mode; - grd_curscreen->sc_w = w; - grd_curscreen->sc_h = h; - grd_curscreen->sc_aspect = fixdiv(grd_curscreen->sc_w*3,grd_curscreen->sc_h*4); - grd_curscreen->sc_canvas.cv_bitmap.bm_x = 0; - grd_curscreen->sc_canvas.cv_bitmap.bm_y = 0; - grd_curscreen->sc_canvas.cv_bitmap.bm_w = w; - grd_curscreen->sc_canvas.cv_bitmap.bm_h = h; - grd_curscreen->sc_canvas.cv_bitmap.bm_rowsize = r; - grd_curscreen->sc_canvas.cv_bitmap.bm_type = t; - grd_curscreen->sc_canvas.cv_bitmap.bm_data = (unsigned char *)data; - VGA_current_mode = mode; - gr_set_current_canvas(NULL); - - //gr_enable_default_palette_loading(); -// gamefont_choose_game_font(w,h); - - return 0; -} - -int gr_init(void) -{ - int org_gamma; - int retcode; - int mode = SM(320,200); - - // Only do this function once! - if (gr_installed==1) - return 3; - -#ifdef __DJGPP__ - if (!__djgpp_nearptr_enable()) { - printf("nearptr enable=%x\n", __dpmi_error); - return 10; - } -#ifndef SAVEGR - gr_video_memory = (unsigned char *)(__djgpp_conventional_base + 0xa0000); -#else - gr_video_memory=(unsigned char *)-1; -#endif - pVideoMode = (volatile ubyte *)(__djgpp_conventional_base+0x449); - pNumColumns = (volatile ushort *)(__djgpp_conventional_base+0x44a); - pNumRows = (volatile ubyte *)(__djgpp_conventional_base+0x484); - pCharHeight = (volatile ushort *)(__djgpp_conventional_base+0x485); - pCursorPos = (volatile ushort *)(__djgpp_conventional_base+0x450); - pCursorType = (volatile ushort *)(__djgpp_conventional_base+0x460); - pTextMemory = (volatile ushort *)(__djgpp_conventional_base+0xb8000); -#endif -#ifndef __DJGPP__ - if (gr_init_A0000()) - return 10; -#endif - - // Save the current text screen mode - if (gr_save_mode()==1) - return 2; - -#ifndef NOGRAPH - // Save the current palette, and fade it out to black. - gr_palette_read( gr_pal_default ); - gr_palette_faded_out = 0; - org_gamma = gr_palette_get_gamma(); - gr_palette_set_gamma( 0 ); - gr_palette_fade_out( gr_pal_default, 32, 0 ); - gr_palette_clear(); - gr_palette_set_gamma( org_gamma ); - gr_sync_display(); - gr_sync_display(); -#endif - -#ifdef __DJGPP__ -#ifdef SAVEGR - __djgpp_nearptr_disable(); -#endif -#endif - - MALLOC( grd_curscreen,grs_screen,1 ); - memset( grd_curscreen, 0, sizeof(grs_screen)); - - // Set the mode. - if ((retcode=gr_set_mode(mode))) - { - gr_restore_mode(); - return retcode; - } - //JOHNgr_disable_default_palette_loading(); - - // Set all the screen, canvas, and bitmap variables that - // aren't set by the gr_set_mode call: - grd_curscreen->sc_canvas.cv_color = 0; - grd_curscreen->sc_canvas.cv_drawmode = 0; - grd_curscreen->sc_canvas.cv_font = NULL; - grd_curscreen->sc_canvas.cv_font_fg_color = 0; - grd_curscreen->sc_canvas.cv_font_bg_color = 0; - gr_set_current_canvas( &grd_curscreen->sc_canvas ); - -#if 0 - if (!dpmi_allocate_selector( &gr_fade_table, 256*GR_FADE_LEVELS, &gr_fade_table_selector )) - Error( "Error allocating fade table selector!" ); - - if (!dpmi_allocate_selector( &gr_palette, 256*3, &gr_palette_selector )) - Error( "Error allocating palette selector!" ); -#endif - -// if (!dpmi_allocate_selector( &gr_inverse_table, 32*32*32, &gr_inverse_table_selector )) -// Error( "Error allocating inverse table selector!" ); - - - // Set flags indicating that this is installed. - gr_installed = 1; -#ifdef __GNUC__ - - atexit((void (*)) gr_close); -#else - atexit(gr_close); -#endif - return 0; -} - -int gr_mode13_checkmode() -{ - if (isvga()) - return 0; - else - return 1; -} - -// 0=Mode set OK -// 1=No VGA adapter installed -// 2=Program doesn't support this VESA granularity -// 3=Monitor doesn't support that VESA mode.: -// 4=Video card doesn't support that VESA mode. -// 5=No VESA driver found. -// 6=Bad Status after VESA call/ -// 7=Not enough DOS memory to call VESA functions. -// 8=Error using DPMI. -// 9=Error setting logical line width. -// 10=Error allocating selector for A0000h -// 11=Not a valid mode support by gr.lib - -int gr_check_mode(u_int32_t mode) -{ - switch(mode) - { - case SM(320,100)://19: - case SM(320,200): - case SM(320,240): - case SM(360,200): - case SM(360,240): - case SM(376,282): - case SM(320,400): - case SM(320,480): - case SM(360,400): - case SM(360,480): - case SM(360,360): - case SM(376,308): - case SM(376,564): return gr_mode13_checkmode(); - case SM(640,400): return gr_vesa_checkmode( 0x100 ); - case SM(640,480): return gr_vesa_checkmode( 0x101 ); - case SM(800,600): return gr_vesa_checkmode( 0x103 ); - case SM(1024,768): return gr_vesa_setmode( 0x105 ); -// case SM_640x480V15: return gr_vesa_setmode( 0x110 ); -// case SM_800x600V15: return gr_vesa_setmode( 0x113 ); - } - return 11; -} - -/* Palette Stuff Starts Here... */ - -void gr_palette_step_up( int r, int g, int b ) -{ - int i; - ubyte *p; - int temp; - - if (gr_palette_faded_out) return; - - if ( (r==last_r) && (g==last_g) && (b==last_b) ) return; - - last_r = r; last_g = g; last_b = b; - - outp( 0x3c6, 0xff ); - outp( 0x3c8, 0 ); - p=gr_palette; - - for (i=0; i<256; i++ ) { - temp = (int)(*p++) + r + gr_palette_gamma; - if (temp<0) temp=0; - else if (temp>63) temp=63; - outp( 0x3c9, temp ); - temp = (int)(*p++) + g + gr_palette_gamma; - if (temp<0) temp=0; - else if (temp>63) temp=63; - outp( 0x3c9, temp ); - temp = (int)(*p++) + b + gr_palette_gamma; - if (temp<0) temp=0; - else if (temp>63) temp=63; - outp( 0x3c9, temp ); - } -} - - -void gr_palette_clear() -{ - int i; - outp( 0x3c6, 0xff ); - outp( 0x3c8, 0 ); - for (i=0; i<768; i++ ) { - outp( 0x3c9, 0 ); - } - gr_palette_faded_out = 1; -} - -void gr_palette_load( ubyte * pal ) -{ - int i; - ubyte c; - outp( 0x3c6, 0xff ); - outp( 0x3c8, 0 ); - for (i=0; i<768; i++ ) { - c = pal[i] + gr_palette_gamma; - if ( c > 63 ) c = 63; - outp( 0x3c9,c); - gr_current_pal[i] = pal[i]; - } - gr_palette_faded_out = 0; - - init_computed_colors(); -} - - -int gr_palette_fade_out(ubyte *pal, int nsteps, int allow_keys ) -{ - ubyte c; - int i,j; - fix fade_palette[768]; - fix fade_palette_delta[768]; - - if (gr_palette_faded_out) return 0; - - if (!pal) - pal = gr_current_pal; - - for (i=0; i<768; i++ ) { - fade_palette[i] = i2f(pal[i]+gr_palette_gamma); - fade_palette_delta[i] = fade_palette[i] / nsteps; - } - - for (j=0; j 63 ) c = 63; - outp( 0x3c9, c ); - } - } - gr_palette_faded_out = 1; - return 0; -} - -int gr_palette_fade_in(ubyte *pal, int nsteps, int allow_keys) -{ - int i,j; - ubyte c; - fix fade_palette[768]; - fix fade_palette_delta[768]; - - - if (!gr_palette_faded_out) return 0; - - for (i=0; i<768; i++ ) { - gr_current_pal[i] = pal[i]; - fade_palette[i] = 0; - fade_palette_delta[i] = i2f(pal[i]+gr_palette_gamma) / nsteps; - } - - for (j=0; j i2f(pal[i]+gr_palette_gamma) ) - fade_palette[i] = i2f(pal[i]+gr_palette_gamma); - c = f2i(fade_palette[i]); - if ( c > 63 ) c = 63; - outp( 0x3c9, c ); - } - } - gr_palette_faded_out = 0; - return 0; -} - -void gr_palette_read(ubyte * palette) -{ - int i; - outp( 0x3c6, 0xff ); - outp( 0x3c7, 0 ); - for (i=0; i<768; i++ ) { - *palette++ = inp( 0x3c9 ); - } -} - -void gr_update(void) -{ } diff --git a/arch/dos/dpmi.c b/arch/dos/dpmi.c deleted file mode 100644 index 9bd503c4..00000000 --- a/arch/dos/dpmi.c +++ /dev/null @@ -1,398 +0,0 @@ -/* -THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -*/ - - -#include -#ifdef __ENV_DJGPP__ - -#ifdef __DJGPP__ -#define _BORLAND_DOS_REGS 1 -#define far -#include -#include -#include -#define FP_SEG(p) _my_ds() -#define FP_OFF(p) (int)p - int _crt0_startup_flags=_CRT0_FLAG_NONMOVE_SBRK+_CRT0_FLAG_FILL_SBRK_MEMORY+_CRT0_FLAG_FILL_DEADBEEF+_CRT0_FLAG_NEARPTR+_CRT0_FLAG_NO_LFN; -#endif - -#include -#include -#include -#include -#include - -#include "pstypes.h" -#include "mono.h" -#include "error.h" -#include "u_dpmi.h" - -int dpmi_find_dos_memory() -{ - union REGS r; - - memset(&r,0,sizeof(r)); - r.x.eax = 0x0100; // DPMI allocate DOS memory - r.x.ebx = 0xffff; // Number of paragraphs requested - int386 (0x31, &r, &r); - //if ( (r.x.eax & 0xffff) == 0x08 ) - //if ( (r.x.eax & 0xffff) == 0x08 ) - if ( r.x.cflag ) - return ((r.x.ebx & 0xffff)*16); - else - return 640*1024; -} - -void *dpmi_real_malloc( int size, ushort *selector ) -{ - union REGS r; - - memset(&r,0,sizeof(r)); - r.x.eax = 0x0100; // DPMI allocate DOS memory - r.x.ebx = (size + 15) >> 4; // Number of paragraphs requested - int386 (0x31, &r, &r); - - if (r.x.cflag) // Failed - return ((uint) 0); - - if(selector!=NULL) - *selector = r.x.edx & 0xFFFF; - -#ifdef __DJGPP__ - return (void *) ((r.x.eax & 0xFFFF) << 4)+__djgpp_conventional_base; -#else - return (void *) ((r.x.eax & 0xFFFF) << 4); -#endif -} - -void dpmi_real_free( ushort selector ) -{ - union REGS r; - - memset(&r,0,sizeof(r)); - r.x.eax = 0x0101; // DPMI free DOS memory - r.x.ebx = selector; // Selector to free - int386 (0x31, &r, &r); -} - -int dos_stack_initialized = 0; -ubyte * dos_stack = NULL; -ubyte * dos_stack_top = NULL; -#define DOS_STACK_SIZE (4*1024) // A big ol' 4K stack!!! - -static void dpmi_setup_stack(dpmi_real_regs *rregs) { - ushort temp_selector; - - if ( !dos_stack_initialized ) { - dos_stack_initialized = 1; - dos_stack = dpmi_real_malloc( DOS_STACK_SIZE, &temp_selector ); - if ( dos_stack == NULL ) { - printf( "Error allocating real mode stack!\n" ); - dos_stack_top = NULL; - } else { - dos_stack_top = &dos_stack[DOS_STACK_SIZE]; - } - } - - // Give this puppy a stack!!! - if ( dos_stack_top ) { - rregs->ss = DPMI_real_segment(dos_stack_top); - rregs->sp = DPMI_real_offset(dos_stack_top); - } -} - - -void dpmi_real_int386x( ubyte intno, dpmi_real_regs * rregs ) -{ - union REGS regs; - struct SREGS sregs; - - /* Use DMPI call 300h to issue the DOS interrupt */ - - dpmi_setup_stack(rregs); - memset(®s,0,sizeof(regs)); - memset(&sregs,0,sizeof(sregs)); - regs.w.ax = 0x0300; - regs.h.bl = intno; - regs.h.bh = 0; - regs.w.cx = 0; - sregs.es = FP_SEG(rregs); - regs.x.edi = FP_OFF(rregs); - int386x( 0x31, ®s, ®s, &sregs ); -} - -void dpmi_real_call(dpmi_real_regs * rregs) -{ - union REGS regs; - struct SREGS sregs; - - dpmi_setup_stack(rregs); - - /* Use DMPI call 301h to call real mode procedure */ - memset(®s,0,sizeof(regs)); - memset(&sregs,0,sizeof(sregs)); - regs.w.ax = 0x0301; - regs.h.bh = 0; - regs.w.cx = 0; - sregs.es = FP_SEG(rregs); - regs.x.edi = FP_OFF(rregs); - int386x( 0x31, ®s, ®s, &sregs ); - if ( regs.x.cflag ) - exit(regs.w.ax); -} - -int total_bytes = 0; - -int dpmi_unlock_region(void *address, unsigned length) -{ - union REGS regs; - unsigned int linear; - - linear = (unsigned int) address; -#ifdef __DJGPP__ - linear += __djgpp_base_address; -#endif - - total_bytes -= length; - //mprintf( 1, "DPMI unlocked %d bytes\n", total_bytes ); - - memset(®s,0,sizeof(regs)); - regs.w.ax = 0x601; // DPMI Unlock Linear Region - regs.w.bx = (linear >> 16); // Linear address in BX:CX - regs.w.cx = (linear & 0xFFFF); - - regs.w.si = (length >> 16); // Length in SI:DI - regs.w.di = (length & 0xFFFF); - int386 (0x31, ®s, ®s); - return (! regs.w.cflag); // Return 0 if can't lock -} - -int dpmi_lock_region(void *address, unsigned length) -{ - union REGS regs; - unsigned int linear; - - linear = (unsigned int) address; -#ifdef __DJGPP__ - linear += __djgpp_base_address; -#endif - - total_bytes += length; - //mprintf( 1, "DPMI Locked down %d bytes\n", total_bytes ); - - memset(®s,0,sizeof(regs)); - regs.w.ax = 0x600; // DPMI Lock Linear Region - regs.w.bx = (linear >> 16); // Linear address in BX:CX - regs.w.cx = (linear & 0xFFFF); - - regs.w.si = (length >> 16); // Length in SI:DI - regs.w.di = (length & 0xFFFF); - int386 (0x31, ®s, ®s); - return (! regs.w.cflag); // Return 0 if can't lock -} - - -int dpmi_modify_selector_base( ushort selector, void * address ) -{ - union REGS regs; - unsigned int linear; - - linear = (unsigned int)address; -#ifdef __DJGPP__ - linear += __djgpp_base_address; -#endif - - memset(®s,0,sizeof(regs)); - regs.w.ax = 0x0007; // DPMI Change Selector Base Addres - regs.w.bx = selector; // Selector to change - regs.w.cx = (linear >> 16); // Base address - regs.w.dx = (linear & 0xFFFF); - int386 (0x31, ®s, ®s); // call dpmi - if (regs.w.cflag) - return 0; // Return 0 if error - - return 1; -} - - -int dpmi_modify_selector_limit( ushort selector, int size ) -{ - union REGS regs; - unsigned int segment_limit; - - segment_limit = (unsigned int) size; - - memset(®s,0,sizeof(regs)); - regs.w.ax = 0x0008; // DPMI Change Selector Limit - regs.w.bx = selector; // Selector to change - regs.w.cx = (segment_limit >> 16); // Size of selector - regs.w.dx = (segment_limit & 0xFFFF); - int386 (0x31, ®s, ®s); // call dpmi - if (regs.w.cflag) - return 0; // Return 0 if error - - return 1; -} - - -int dpmi_allocate_selector( void * address, int size, ushort * selector ) -{ - union REGS regs; - - - memset(®s,0,sizeof(regs)); - regs.w.ax = 0; // DPMI Allocate Selector - regs.w.cx = 1; // Allocate 1 selector - int386 (0x31, ®s, ®s); // call dpmi - if (regs.w.cflag) - return 0; // Return 0 if error - *selector = regs.w.ax; - - if ( !dpmi_modify_selector_base( *selector, address ) ) - return 0; - - if ( !dpmi_modify_selector_limit( *selector, size ) ) - return 0; - -// mprintf( 0, "Selector 0x%4x has base of 0x%8x, size %d bytes\n", *selector, linear,segment_limit); - - return 1; -} - -static void * dpmi_dos_buffer = NULL; -static ushort dpmi_dos_selector = 0; - -void dpmi_close() -{ - if (dpmi_dos_selector!=0) { - dpmi_dos_buffer = NULL; - dpmi_dos_selector = 0; - } -} - -typedef struct mem_data { - int largest_block_bytes; - int max_unlocked_page_allocation; - int largest_lockable_pages; - int total_pages; - int unlocked_pages; - int unused_physical_pages; - int total_physical_pages; - int free_linear_pages; - int paging_size_pages; - int reserved[3]; -} mem_data; - -unsigned int dpmi_virtual_memory=0; -unsigned int dpmi_available_memory=0; -unsigned int dpmi_physical_memory=0; -unsigned int dpmi_dos_memory = 0; - -#ifdef __WATCOMC__ -extern void cdecl _GETDS(); -extern void cdecl cstart_(); -#endif - -int dpmi_init(int verbose) -{ - union REGS regs; - struct SREGS sregs; - mem_data mi; - - dpmi_dos_memory = dpmi_find_dos_memory(); - - dpmi_dos_buffer = dpmi_real_malloc( 1024, &dpmi_dos_selector); - if (!dpmi_dos_buffer) { - dpmi_dos_selector = 0; - printf( "Error allocating 1K of DOS memory\n" ); - exit(1); - } - atexit(dpmi_close); - - // Check dpmi - memset(®s,0,sizeof(regs)); - regs.x.eax = 0x400; // DPMI Get Memory Info - int386( 0x31, ®s, ®s ); - if (!regs.w.cflag) { - if (verbose) printf( "V%d.%d, CPU:%d, VMM:", regs.h.ah, regs.h.al, regs.h.cl ); - if (regs.w.bx & 4) { - if (verbose) printf( "1" ); - dpmi_virtual_memory = 1; - } else { - if (verbose) printf( "0" ); - } - } - - //--------- Find available memory - memset(®s,0,sizeof(regs)); - memset(&sregs,0,sizeof(sregs)); - regs.x.eax = 0x500; // DPMI Get Memory Info - sregs.es = FP_SEG(&mi); - regs.x.edi = FP_OFF(&mi); - int386x( 0x31, ®s, ®s, &sregs ); - if (!regs.w.cflag) { - if (verbose) printf( ", P:%dK", mi.largest_lockable_pages*4 ); - if (dpmi_virtual_memory) - if (verbose) printf( ", A:%dK", mi.largest_block_bytes/1024 ); - //dpmi_physical_memory = mi.largest_lockable_pages*4096; - //dpmi_available_memory = mi.largest_block_bytes; - dpmi_physical_memory = mi.total_physical_pages*4096; - dpmi_available_memory = mi.total_pages * 4096; - } else { - if (verbose) printf( "MemInfo failed!" ); - dpmi_physical_memory = 16*1024*1024; // Assume 16 MB - dpmi_available_memory = 16*1024*1024; // Assume 16 MB - } - -#ifdef __WATCOMC__ - if (!dpmi_lock_region( _GETDS, 4096 )) { - printf( "Error locking _GETDS" ); - exit(1); - } - if (!dpmi_lock_region( cstart_, 4096 )) { - printf( "Error locking cstart" ); - exit(1); - } - if (!dpmi_lock_region( _chain_intr, 4096 )) { - printf( "Error locking _chain_intr" ); - exit(1); - } -#endif - return 1; -} - -void *dpmi_get_temp_low_buffer( int size ) -{ - if ( dpmi_dos_buffer == NULL ) return NULL; - if ( size > 1024 ) return NULL; - - return dpmi_dos_buffer; -} - -int dpmi_set_pm_handler(unsigned intnum, void far * isr ) -{ - union REGS regs; - - /* Use DMPI call 204h to get pm interrrupt */ - memset(®s,0,sizeof(regs)); - regs.w.ax = 0x0205; - regs.h.bl = intnum; - regs.w.cx = FP_SEG(isr); - regs.x.edx = FP_OFF(isr); - int386( 0x31, ®s, ®s ); - if (!regs.w.cflag) - return 0; - return 1; -} - -#endif // __ENV_DJGPP__ diff --git a/arch/dos/findfile.c b/arch/dos/findfile.c deleted file mode 100644 index 4db5c8cb..00000000 --- a/arch/dos/findfile.c +++ /dev/null @@ -1,95 +0,0 @@ -/* -THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -*/ - - -#include -#ifdef __ENV_DJGPP__ - -#include -#include - -#include "findfile.h" - - -// Global Variables ---------------------------------------------------------- - -static int _FileFindFlag = 0; -static struct find_t _FileFindStruct; - - - -// Functions - -int FileFindFirst(char *search_str, FILEFINDSTRUCT *ffstruct) -{ - unsigned retval; - - if (_FileFindFlag) return -1; - - retval = _dos_findfirst(search_str, 0, &_FileFindStruct); - if (retval) return (int)retval; - else { - ffstruct->size = _FileFindStruct.size; - strcpy(ffstruct->name, _FileFindStruct.name); - _FileFindFlag = 1; - return (int)retval; - } -} - - -int FileFindNext(FILEFINDSTRUCT *ffstruct) -{ - unsigned retval; - - if (!_FileFindFlag) return -1; - - retval = _dos_findnext(&_FileFindStruct); - if (retval) return (int)retval; - else { - ffstruct->size = _FileFindStruct.size; - strcpy(ffstruct->name, _FileFindStruct.name); - return (int)retval; - } -} - - -int FileFindClose(void) -{ - unsigned retval = 0; - - if (!_FileFindFlag) return -1; - - if (retval) return (int)retval; - else { - _FileFindFlag = 0; - return (int)retval; - } -} - - -//returns 0 if no error -int GetFileDateTime(int filehandle, FILETIMESTRUCT *ftstruct) -{ - return _dos_getftime(filehandle, &ftstruct->date, &ftstruct->time); - -} - - -//returns 0 if no error -int SetFileDateTime(int filehandle, FILETIMESTRUCT *ftstruct) -{ - return _dos_setftime(filehandle, ftstruct->date, ftstruct->time); -} - - -#endif //__ENV_DJGPP__ diff --git a/arch/dos/include/Makefile.am b/arch/dos/include/Makefile.am new file mode 100644 index 00000000..7568225f --- /dev/null +++ b/arch/dos/include/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ +commlib.h disk.h dzcomm.h midiallg.h serial.h diff --git a/arch/dos/include/joy.h b/arch/dos/include/joy.h deleted file mode 100644 index 21786406..00000000 --- a/arch/dos/include/joy.h +++ /dev/null @@ -1,188 +0,0 @@ -/* -THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -*/ -/* - * $Source: /cvs/cvsroot/d2x/arch/dos/include/joy.h,v $ - * $Revision: 1.1.1.2 $ - * $Author: bradleyb $ - * $Date: 2001-01-19 03:33:52 $ - * - * Headers for joystick functions - * - * $Log: not supported by cvs2svn $ - * Revision 1.1.1.1 1999/06/14 22:00:11 donut - * Import of d1x 1.37 source. - * - * Revision 1.17 1995/10/07 13:22:30 john - * Added new method of reading joystick that allows higher-priority - * interrupts to go off. - * - * Revision 1.16 1995/02/14 11:17:13 john - * Added BIOS readings for stick. - * - * Revision 1.15 1995/02/14 10:09:58 john - * Added OS2 switch. - * - * Revision 1.14 1994/12/28 13:49:20 john - * Added function to set joystick for slow reading - * - * Revision 1.13 1994/10/13 11:36:06 john - * Made joy_down_time be kept track of in fixed seconds, - * not ticks. - * - * Revision 1.12 1994/10/12 17:03:16 john - * Added prototype for joy_get_scaled_reading. - * - * Revision 1.11 1994/10/12 16:57:55 john - * Added function to set a joystick button's state. - * - * Revision 1.10 1994/09/22 16:09:00 john - * Fixed some virtual memory lockdown problems with timer and - * joystick. - * - * Revision 1.9 1994/08/31 09:54:57 john - * *** empty log message *** - * - * Revision 1.8 1994/08/29 21:02:24 john - * Added joy_set_cal_values... - * - * Revision 1.7 1994/08/29 20:51:52 john - * Added better cyberman support; also, joystick calibration - * value return funcctiionn, - * - * Revision 1.6 1994/07/01 10:55:44 john - * Fixed some bugs... added support for 4 axis. - * - * Revision 1.5 1994/06/30 20:36:51 john - * Revamped joystick code. - * - * Revision 1.4 1994/04/22 12:52:10 john - * *** empty log message *** - * - * Revision 1.3 1994/01/18 13:53:39 john - * Made all joystick functions return int's instead of - * shorts. Also made the stick reading be CPU speed - * independant by using the timer_get_Stamp_64 - * function. - * - * Revision 1.2 1994/01/18 10:58:42 john - * *** empty log message *** - * - * Revision 1.1 1993/07/10 13:10:39 matt - * Initial revision - * - * - */ - -#ifndef _JOY_H -#define _JOY_H - -#include "pstypes.h" -#include "fix.h" - -#define JOY_1_BUTTON_A 1 -#define JOY_1_BUTTON_B 2 -#define JOY_2_BUTTON_A 4 -#define JOY_2_BUTTON_B 8 -#define JOY_ALL_BUTTONS (1+2+4+8) - -#define JOY_1_X_AXIS 1 -#define JOY_1_Y_AXIS 2 -#define JOY_2_X_AXIS 4 -#define JOY_2_Y_AXIS 8 -#define JOY_ALL_AXIS (1+2+4+8) - -#define JOY_SLOW_READINGS 1 -#define JOY_POLLED_READINGS 2 -#define JOY_BIOS_READINGS 4 -#define JOY_FRIENDLY_READINGS 8 - -#define JOY_NUM_AXES 4 - -#define MAX_BUTTONS 20 -//========================================================================== -// This initializes the joy and does a "quick" calibration which -// assumes the stick is centered and sets the minimum value to 0 and -// the maximum value to 2 times the centered reading. Returns 0 if no -// joystick was detected, 1 if everything is ok. -// joy_init() is called. - -extern int joy_init(); -extern void joy_close(); - -extern char joy_installed; -extern char joy_present; - -//========================================================================== -// The following 3 routines can be used to zero in on better joy -// calibration factors. To use them, ask the user to hold the stick -// in either the upper left, lower right, or center and then have them -// press a key or button and then call the appropriate one of these -// routines, and it will read the stick and update the calibration factors. -// Usually, assuming that the stick was centered when joy_init was -// called, you really only need to call joy_set_lr, since the upper -// left position is usually always 0,0 on most joys. But, the safest -// bet is to do all three, or let the user choose which ones to set. - -extern void joy_set_ul(); -extern void joy_set_lr(); -extern void joy_set_cen(); - - -//========================================================================== -// This reads the joystick. X and Y will be between -128 and 127. -// Takes about 1 millisecond in the worst case when the stick -// is in the lower right hand corner. Always returns 0,0 if no stick -// is present. - -extern void joy_get_pos( int *x, int *y ); - -//========================================================================== -// This just reads the buttons and returns their status. When bit 0 -// is 1, button 1 is pressed, when bit 1 is 1, button 2 is pressed. -extern int joy_get_btns(); - -//========================================================================== -// This returns the number of times a button went either down or up since -// the last call to this function. -extern int joy_get_button_up_cnt( int btn ); -extern int joy_get_button_down_cnt( int btn ); - -//========================================================================== -// This returns how long (in approximate milliseconds) that each of the -// buttons has been held down since the last call to this function. -// It is the total time... say you pressed it down for 3 ticks, released -// it, and held it down for 6 more ticks. The time returned would be 9. -extern fix joy_get_button_down_time( int btn ); - -extern ubyte joy_read_raw_buttons(); -extern ubyte joystick_read_raw_axis( ubyte mask, int * axis ); -extern void joy_flush(); -extern ubyte joy_get_present_mask(); -extern void joy_set_timer_rate(int max_value ); -extern int joy_get_timer_rate(); - -extern int joy_get_button_state( int btn ); -extern void joy_set_cen_fake(int channel); -extern ubyte joy_read_stick( ubyte masks, int *axis ); -extern void joy_get_cal_vals(int *axis_min, int *axis_center, int *axis_max); -extern void joy_set_cal_vals(int *axis_min, int *axis_center, int *axis_max); -extern void joy_set_btn_values( int btn, int state, fix timedown, int downcount, int upcount ); -extern int joy_get_scaled_reading( int raw, int axn ); -extern void joy_set_slow_reading( int flag ); - - -extern int JOY_PORT; - -extern int joy_deadzone; -#endif - diff --git a/arch/dos/init.c b/arch/dos/init.c deleted file mode 100644 index 3f74ec43..00000000 --- a/arch/dos/init.c +++ /dev/null @@ -1,369 +0,0 @@ -#include -#ifdef __ENV_DJGPP__ - -#include -#include -#ifdef __DJGPP__ -#define _BORLAND_DOS_REGS 1 -#endif -#include - -#include "../../main/inferno.h" -#include "../../main/text.h" -#include "console.h" -#include "args.h" -#include "error.h" - -#include "joy.h" -#include "timer.h" -#include "key.h" -#include "mono.h" -#include "u_dpmi.h" -#include "mouse.h" - -//added on 9/15/98 by Victor Rachels to add cd controls -//#include "bcd.h" -//end this section addition - Victor Rachels - - -void install_int3_handler(void); - -#ifdef __WATCOMC__ -int __far descent_critical_error_handler( unsigned deverr, unsigned errcode, unsigned far * devhdr ); -#endif - -#ifndef NDEBUG -#ifdef __WATCOMC__ -void do_heap_check() -{ - int heap_status; - - heap_status = _heapset( 0xFF ); - switch( heap_status ) - { - case _HEAPBADBEGIN: - mprintf((1, "ERROR - heap is damaged\n")); - Int3(); - break; - case _HEAPBADNODE: - mprintf((1, "ERROR - bad node in heap\n" )); - Int3(); - break; - } -} -#endif -#endif - - - -#ifdef VR_DEVICES -int is_3dbios_installed() -{ - dpmi_real_regs rregs; - memset(&rregs,0,sizeof(dpmi_real_regs)); - rregs.eax = 0x4ed0; - //rregs.ebx = 0x3d10; - dpmi_real_int386x( 0x10, &rregs ); - if ( (rregs.edx & 0xFFFF) != 0x3344 ) - return 0; - else - return 1; -} -#endif - -// Returns 1 if ok, 0 if failed... -int init_gameport() -{ - union REGS regs; - - memset(®s,0,sizeof(regs)); - regs.x.eax = 0x8400; - regs.x.edx = 0xF0; - int386( 0x15, ®s, ®s ); - if ( ( regs.x.eax & 0xFFFF ) == 0x4753 /*'SG'*/ ) - return 1; - else - return 0; -} - -void check_dos_version() -{ - int major, minor; - union REGS regs; - - memset(®s,0,sizeof(regs)); - regs.x.eax = 0x3000; // Get MS-DOS Version Number - int386( 0x21, ®s, ®s ); - - major = regs.h.al; - minor = regs.h.ah; - - if ( major < 5 ) { - printf( "Using MS-DOS version %d.%d\nThis is not compatable with Descent.", major, minor); - exit(1); - } - //printf( "\nUsing MS-DOS %d.%d...\n", major, minor ); -} - -void dos_check_file_handles(int num_required) -{ - int i, n; - FILE * fp[16]; - - if ( num_required > 16 ) - num_required = 16; - - n = 0; - for (i=0; i<16; i++ ) - fp[i] = NULL; - for (i=0; i<16; i++ ) { - fp[i] = fopen( "nul", "wb" ); - if ( !fp[i] ) break; - } - n = i; - for (i=0; i<16; i++ ) { - if (fp[i]) - fclose(fp[i]); - } - if ( n < num_required ) { - printf( "\n%s\n", TXT_NOT_ENOUGH_HANDLES ); - printf( "------------------------\n" ); - printf( "%d/%d %s\n", n, num_required, TXT_HANDLES_1 ); - printf( "%s\n", TXT_HANDLES_2); - printf( "%s\n", TXT_HANDLES_3); - exit(1); - } -} - -#define NEEDED_DOS_MEMORY ( 300*1024) // 300 K -#define NEEDED_LINEAR_MEMORY (7680*1024) // 7.5 MB -#define LOW_PHYSICAL_MEMORY_CUTOFF (5*1024*1024) // 5.0 MB -#define NEEDED_PHYSICAL_MEMORY (2000*1024) // 2000 KB - -extern int piggy_low_memory; - -void mem_int_to_string( int number, char *dest ) -{ - int i,l,c; - char buffer[20],*p; - - sprintf( buffer, "%d", number ); - - l = strlen(buffer); - if (l<=3) { - // Don't bother with less than 3 digits - sprintf( dest, "%d", number ); - return; - } - - c = l % 3; - p=dest; - for (i=0; i dpmi_physical_memory ) { - mem_int_to_string( (dpmi_available_memory-dpmi_physical_memory)/1024, text ); - } else { - mem_int_to_string( 0, text ); - } - printf( "Virtual: %7s KB\n", text ); - printf( "\n" ); - - if ( dpmi_dos_memory < NEEDED_DOS_MEMORY ) { - printf( "%d %s\n", NEEDED_DOS_MEMORY - dpmi_dos_memory, TXT_MEMORY_CONFIG ); - exit(1); - } - - if ( dpmi_available_memory < NEEDED_LINEAR_MEMORY ) { - if ( dpmi_virtual_memory ) { - printf( "%d %s\n", NEEDED_LINEAR_MEMORY - dpmi_available_memory, TXT_RECONFIGURE_VMM ); - } else { - printf( "%d %s\n", NEEDED_LINEAR_MEMORY - dpmi_available_memory, TXT_MORE_MEMORY ); - printf( "%s\n", TXT_MORE_MEMORY_2); - } - exit(1); - } - - if ( dpmi_physical_memory < NEEDED_PHYSICAL_MEMORY ) { - printf( "%d %s\n", NEEDED_PHYSICAL_MEMORY - dpmi_physical_memory, TXT_PHYSICAL_MEMORY ); - if ( dpmi_virtual_memory ) { - printf( "%s\n", TXT_PHYSICAL_MEMORY_2); - } - exit(1); - } - - if ( dpmi_physical_memory < LOW_PHYSICAL_MEMORY_CUTOFF ) { - piggy_low_memory = 1; - } -} - -//NO_STACK_SIZE_CHECK uint * stack, *stack_ptr; -//NO_STACK_SIZE_CHECK int stack_size, unused_stack_space; -//NO_STACK_SIZE_CHECK int sil; -//NO_STACK_SIZE_CHECK -//NO_STACK_SIZE_CHECK int main(int argc,char **argv) -//NO_STACK_SIZE_CHECK { -//NO_STACK_SIZE_CHECK uint ret_value; -//NO_STACK_SIZE_CHECK -//NO_STACK_SIZE_CHECK unused_stack_space = 0; -//NO_STACK_SIZE_CHECK stack = &ret_value; -//NO_STACK_SIZE_CHECK stack_size = stackavail()/4; -//NO_STACK_SIZE_CHECK -//NO_STACK_SIZE_CHECK for ( sil=0; sil -#include -#include -#include -#include -#include -#include -#include - -#include "types.h" -#include "timer.h" -#include "ipx.h" -#include "error.h" -#include "u_dpmi.h" -#include "key.h" - -typedef unsigned char BYTE; -typedef unsigned short WORD; -typedef unsigned long DWORD; - -typedef struct local_address { - ubyte address[6]; -} __pack__ local_address; - -typedef struct net_address { - BYTE network_id[4]; - local_address node_id; - WORD socket_id; -} __pack__ net_address; - -typedef struct ipx_header { - WORD checksum; - WORD length; - BYTE transport_control; - BYTE packet_type; - net_address destination; - net_address source; -} __pack__ ipx_header; - -typedef struct ecb_header { - WORD link[2]; - WORD esr_address[2]; - BYTE in_use; - BYTE completion_code; - WORD socket_id; - BYTE ipx_reserved[14]; - WORD connection_id; - local_address immediate_address; - WORD fragment_count; - WORD fragment_pointer[2]; - WORD fragment_size; -} __pack__ ecb_header; - -typedef struct packet_data { - int packetnum; - byte data[IPX_MAX_DATA_SIZE]; -} __pack__ packet_data; - -typedef struct ipx_packet { - ecb_header ecb; - ipx_header ipx; - packet_data pd; -} __pack__ ipx_packet; - -typedef struct user_address { - ubyte network[4]; - ubyte node[6]; - ubyte address[6]; -} __pack__ user_address; - -#define MAX_USERS 64 -int Ipx_num_users = 0; -user_address Ipx_users[MAX_USERS]; - -#define MAX_NETWORKS 64 -int Ipx_num_networks = 0; -uint Ipx_networks[MAX_NETWORKS]; - -int ipx_packetnum = 0; - -#define MAX_PACKETS 64 - -static packet_data packet_buffers[MAX_PACKETS]; -static short packet_free_list[MAX_PACKETS]; -static int num_packets = 0; -static int largest_packet_index = 0; -static short packet_size[MAX_PACKETS]; - -WORD ipx_socket=0; -ubyte ipx_installed=0; -WORD ipx_vector_segment; -WORD ipx_vector_offset; -ubyte ipx_socket_life = 0; // 0=closed at prog termination, 0xff=closed when requested. -DWORD ipx_network = 0; -local_address ipx_my_node; -WORD ipx_num_packets=32; // 32 Ipx packets -ipx_packet * packets; -int neterrors = 0; -ushort ipx_packets_selector; - -ecb_header * last_ecb=NULL; -int lastlen=0; - -void got_new_packet( ecb_header * ecb ); -void ipx_listen_for_packet(ecb_header * ecb ); - -void free_packet( int id ) -{ - packet_buffers[id].packetnum = -1; - packet_free_list[ --num_packets ] = id; - if (largest_packet_index==id) - while ((--largest_packet_index>0) && (packet_buffers[largest_packet_index].packetnum == -1 )); -} - -int ipx_get_packet_data( ubyte * data ) -{ - int i, n, best, best_id, size; - - for (i=1; i -1 ) { - n++; - if ( best == -1 || (packet_buffers[i].packetnum ", neterrors )); - - if ( best_id < 0 ) return 0; - - size = packet_size[best_id]; - memcpy( data, packet_buffers[best_id].data, size ); - free_packet(best_id); - - return size; -} - -#ifndef __GNUC__ -unsigned int swap_short( unsigned int short ) -#pragma aux swap_short parm [eax] = "xchg al,ah"; -#else -static inline unsigned int swap_short( unsigned int sshort ) { - int __retval; - asm("xchg %%ah,%%al" : "=a" (__retval) : "a" (sshort)); - return __retval; -} -#endif - -void got_new_packet( ecb_header * ecb ) -{ - ipx_packet * p; - int id; - unsigned short datasize; - - datasize = 0; - last_ecb = ecb; - p = (ipx_packet *)ecb; - - if ( p->ecb.in_use ) { neterrors++; return; } - if ( p->ecb.completion_code ) { neterrors++; return; } - - // Error( "Recieve error %d for completion code", p->ecb.completion_code ); - - if ( memcmp( &p->ipx.source.node_id, &ipx_my_node, 6 ) ) { - datasize=swap_short(p->ipx.length); - lastlen=datasize; - datasize -= sizeof(ipx_header); - // Find slot to put packet in... - if ( datasize > 0 && datasize <= sizeof(packet_data) ) { - if ( num_packets >= MAX_PACKETS ) { - //printf( 1, "IPX: Packet buffer overrun!!!\n" ); - neterrors++; - return; - } - id = packet_free_list[ num_packets++ ]; - if (id > largest_packet_index ) largest_packet_index = id; - packet_size[id] = datasize-sizeof(int); - packet_buffers[id].packetnum = p->pd.packetnum; - if ( packet_buffers[id].packetnum < 0 ) { neterrors++; return; } - memcpy( packet_buffers[id].data, p->pd.data, packet_size[id] ); - } else { - neterrors++; return; - } - } - // Repost the ecb - p->ecb.in_use = 0; - //ipx_listen_for_packet(&p->ecb); -} - -ubyte * ipx_get_my_local_address() -{ - return ipx_my_node.address; -} - -ubyte * ipx_get_my_server_address() -{ - return (ubyte *)&ipx_network; -} - -void ipx_listen_for_packet(ecb_header * ecb ) -{ - dpmi_real_regs rregs; - ecb->in_use = 0x1d; - memset(&rregs,0,sizeof(dpmi_real_regs)); - rregs.ebx = 4; // Listen For Packet function - rregs.esi = DPMI_real_offset(ecb); - rregs.es = DPMI_real_segment(ecb); - dpmi_real_int386x( 0x7A, &rregs ); -} - -void ipx_cancel_listen_for_packet(ecb_header * ecb ) -{ - dpmi_real_regs rregs; - memset(&rregs,0,sizeof(dpmi_real_regs)); - rregs.ebx = 6; // IPX Cancel event - rregs.esi = DPMI_real_offset(ecb); - rregs.es = DPMI_real_segment(ecb); - dpmi_real_int386x( 0x7A, &rregs ); -} - - -void ipx_send_packet(ecb_header * ecb ) -{ - dpmi_real_regs rregs; - memset(&rregs,0,sizeof(dpmi_real_regs)); - rregs.ebx = 3; // Send Packet function - rregs.esi = DPMI_real_offset(ecb); - rregs.es = DPMI_real_segment(ecb); - dpmi_real_int386x( 0x7A, &rregs ); -} - -typedef struct { - ubyte network[4]; - ubyte node[6]; - ubyte local_target[6]; -} __pack__ net_xlat_info; - -void ipx_get_local_target( ubyte * server, ubyte * node, ubyte * local_target ) -{ - net_xlat_info * info; - dpmi_real_regs rregs; - - // Get dos memory for call... - info = (net_xlat_info *)dpmi_get_temp_low_buffer( sizeof(net_xlat_info) ); - assert( info != NULL ); - memcpy( info->network, server, 4 ); - memcpy( info->node, node, 6 ); - - memset(&rregs,0,sizeof(dpmi_real_regs)); - - rregs.ebx = 2; // Get Local Target - rregs.es = DPMI_real_segment(info); - rregs.esi = DPMI_real_offset(info->network); - rregs.edi = DPMI_real_offset(info->local_target); - - dpmi_real_int386x( 0x7A, &rregs ); - - // Save the local target... - memcpy( local_target, info->local_target, 6 ); -} - -void ipx_close() -{ - dpmi_real_regs rregs; - if ( ipx_installed ) { - // When using VLM's instead of NETX, the sockets don't - // seem to automatically get closed, so we must explicitly - // close them at program termination. - ipx_installed = 0; - memset(&rregs,0,sizeof(dpmi_real_regs)); - rregs.edx = ipx_socket; - rregs.ebx = 1; // Close socket - dpmi_real_int386x( 0x7A, &rregs ); - } -} - - -//--------------------------------------------------------------- -// Initializes all IPX internals. -// If socket_number==0, then opens next available socket. -// Returns: 0 if successful. -// -1 if socket already open. -// -2 if socket table full. -// -3 if IPX not installed. -// -4 if couldn't allocate low dos memory -// -5 if error with getting internetwork address - -int ipx_init( int socket_number, int show_address ) -{ - dpmi_real_regs rregs; - ubyte *ipx_real_buffer; - int i; - - atexit(ipx_close); - - ipx_packetnum = 0; - - // init packet buffers. - for (i=0; i= IPX_MAX_DATA_SIZE ) { - printf( "Data too big\n" ); -//added/replaced on 11/8/98 by Victor Rachels to stop crappage - return; -// exit(1); -//end this section replacement - VR - } - - // Make sure no one is already sending something - while( packets[0].ecb.in_use ) - { - } - - if (packets[0].ecb.completion_code) { -// printf( "Send error %d for completion code\n", packets[0].ecb.completion_code ); -//added/replaced on 11/8/98 by Victor Rachels to stop crappage - return; - // exit(1); -//end this section replacement - VR - - } - - // Fill in destination address - if ( memcmp( network, &ipx_network, 4 ) ) - memcpy( packets[0].ipx.destination.network_id, network, 4 ); - else - memset( packets[0].ipx.destination.network_id, 0, 4 ); - memcpy( packets[0].ipx.destination.node_id.address, address, 6 ); - memcpy( packets[0].ecb.immediate_address.address, immediate_address, 6 ); - packets[0].pd.packetnum = ipx_packetnum++; - - // Fill in data to send - packets[0].ecb.fragment_size = sizeof(ipx_header) + sizeof(int) + datasize; - - assert( datasize > 1 ); - assert( packets[0].ecb.fragment_size <= 576 ); - - memcpy( packets[0].pd.data, data, datasize ); - - // Send it - ipx_send_packet( &packets[0].ecb ); - -} - -void ipx_send_broadcast_packet_data( ubyte * data, int datasize ) -{ - int i, j; - ubyte broadcast[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; - ubyte local_address[6]; - - // Set to all networks besides mine - for (i=0; i= Ipx_num_networks ) { - memcpy( &Ipx_networks[Ipx_num_networks++], tmp.network, 4 ); - printf(" %02x%02x%02x%02x\n", tmp.network[0], tmp.network[1], tmp.network[2], tmp.network[3] ); - } - } else { - printf( "Too many networks in %s! (Limit of %d)\n", filename, MAX_NETWORKS ); - fclose(fp); - return; - } - } - fclose(fp); - -} - -//---typedef struct rip_entry { -//--- uint network; -//--- ushort nhops; -//--- ushort nticks; -//---} rip_entry; -//--- -//---typedef struct rip_packet { -//--- ushort operation; //1=request, 2=response -//--- rip_entry rip[50]; -//---} rip_packet; -//--- -//--- -//---void ipx_find_all_servers() -//---{ -//--- int i; -//--- rip_packet * rp; -//--- assert(ipx_installed); -//--- -//--- ipx_change_default_socket( 0x0453 ); -//--- // ipx_change_default_socket( 0x5304 ); -//--- -//--- // Make sure no one is already sending something -//--- while( packets[0].ecb.in_use ) -//--- { -//--- } -//--- -//--- if (packets[0].ecb.completion_code) { -//--- printf( "AAAA:Send error %d for completion code\n", packets[0].ecb.completion_code ); -//--- //exit(1); -//--- } -//--- -//--- rp = (rip_packet *)&packets[0].pd; -//--- -//--- // Fill in destination address -//--- { -//--- char mzero1[] = {0,0,0,1}; -//--- char mzero[] = {0,0,0,0,0,1}; -//--- char immediate[6]; -//--- //memcpy( packets[0].ipx.destination.network_id, &ipx_network, 4 ); -//--- //memcpy( packets[0].ipx.destination.node_id.address, ipx_my_node.address, 6 ); -//--- -//--- memcpy( packets[0].ipx.destination.network_id, mzero1, 4 ); -//--- memcpy( packets[0].ipx.destination.node_id.address, mzero, 6 ); -//--- -//--- memcpy( packets[0].ipx.destination.socket_id, &ipx_socket, 2 ); -//--- memcpy( packets[0].ipx.source.network_id, &ipx_network, 4 ); -//--- memcpy( packets[0].ipx.source.node_id.address, ipx_my_node.address, 6 ); -//--- memcpy( packets[0].ipx.source.socket_id, &ipx_socket, 2 ); -//--- //memcpy( packets[0].ecb.immediate_address.address, ipx_my_node.address, 6 ); -//--- //mzero1[3] = 1; -//--- //memcpy( packets[0].ipx.destination.network_id, mzero1, 4 ); -//--- //mzero[5] = 1; -//--- //memcpy( packets[0].ipx.destination.node_id.address, mzero, 6 ); -//--- //ipx_get_local_target( mzero1, mzero, immediate ); -//--- //memcpy( packets[0].ecb.immediate_address.address, mzero, 6 ); -//--- //memcpy( packets[0].ecb.immediate_address.address, immediate, 6 ); -//--- //mzero[5] = 0; -//--- } -//--- -//--- packets[0].ipx.packet_type = 1; // RIP packet -//--- -//--- // Fill in data to send -//--- packets[0].ecb.fragment_size = sizeof(ipx_header) + sizeof(rip_packet); -//--- assert( packets[0].ecb.fragment_size <= 576 ); -//--- -//--- rp->operation = 0; // Request -//--- for (i=0;i<50; i++) { -//--- rp->rip[i].network = 0xFFFFFFFF; -//--- rp->rip[i].nhops = 0; -//--- rp->rip[i].nticks = 0; -//--- } -//--- -//--- // Send it -//--- ipx_send_packet( &packets[0].ecb ); -//--- -//--- for (i=0;i<50; i++) { -//--- if ( rp->rip[i].network != 0xFFFFFFFF ) -//--- printf( "Network = %8x, Hops=%d, Ticks=%d\n", rp->rip[i].network, rp->rip[i].nhops, rp->rip[i].nticks ); -//--- } -//---} -//--- -//--- diff --git a/arch/dos/joy2.asm b/arch/dos/joy2.asm deleted file mode 100644 index 69d22c56..00000000 --- a/arch/dos/joy2.asm +++ /dev/null @@ -1,471 +0,0 @@ -;THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -;SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -;END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -;ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -;IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -;SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -;FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -;CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -;AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -; -; $Source: /cvs/cvsroot/d2x/arch/dos/joy2.asm,v $ -; $Revision: 1.1.1.1 $ -; $Author: bradleyb $ -; $Date: 2001-01-19 03:30:15 $ -; -; Contains routines for joystick interface. -; -; $Log: not supported by cvs2svn $ -; Revision 1.1.1.1 1999/06/14 21:57:53 donut -; Import of d1x 1.37 source. -; -; Revision 1.17 1995/10/07 13:22:11 john -; Added new method of reading joystick that allows higher-priority -; interrupts to go off. -; -; Revision 1.16 1995/03/30 11:03:30 john -; Made -JoyBios read buttons using BIOS. -; -; Revision 1.15 1995/02/14 11:39:36 john -; Added polled/bios joystick readers.. -; -; Revision 1.14 1995/01/29 18:36:00 john -; Made timer count in mode 2 instead of mode 3. -; -; Revision 1.13 1994/12/28 15:32:21 john -; Added code to read joystick axis not all at one time. -; -; Revision 1.12 1994/12/27 15:44:59 john -; Made the joystick timeout be at 1/100th of a second, -; regardless of CPU speed. -; -; Revision 1.11 1994/11/15 12:04:40 john -; Cleaned up timer code a bit... took out unused functions -; like timer_get_milliseconds, etc. -; -; Revision 1.10 1994/07/01 10:55:54 john -; Fixed some bugs... added support for 4 axis. -; -; Revision 1.9 1994/06/30 20:36:54 john -; Revamped joystick code. -; -; Revision 1.8 1994/04/22 12:52:06 john - -[BITS 32] - -[SECTION .data] - - LastTick dd 0 - TotalTicks dd 0 - - global _joy_bogus_reading - global _joy_retries - extern _JOY_PORT - _joy_bogus_reading dd 0 - _joy_retries dd 0 - RetryCount dd 0 - - -[SECTION .text] - -; JOY_PORT EQU 0209h - TDATA EQU 40h - TCOMMAND EQU 43h - -joy_get_timer: - xor al, al ; Latch timer 0 command - out TCOMMAND, al ; Latch timer - in al, TDATA ; Read lo byte - mov ah, al - in al, TDATA ; Read hi byte - xchg ah, al - and eax, 0ffffh - ret - - - - -global _joy_read_stick_friendly2 -_joy_read_stick_friendly2: - push ebx - push edi - - mov ebx,[esp+12] - mov edi,[esp+16] - mov ecx,[esp+20] - - ; ebx = read mask - ; edi = pointer to event buffer - ; ecx = timeout value - ; returns in eax the number of events - - mov dword [RetryCount], 0 - mov dword [_joy_bogus_reading], 0 - -_joy_read_stick_friendly_retry: - inc dword [RetryCount] - cmp dword [RetryCount], 3 - jbe @@f1 - mov dword [_joy_bogus_reading], 1 - inc dword [_joy_retries] - mov eax, 0 - pop edi - pop ebx - ret - -@@f1: - push ecx - push ebx - push edi - - and ebx, 01111b ; Make sure we only check the right values - ; number of events we found will be in bh, so this also clears it to zero. - - mov dx, [_JOY_PORT] - - cli ; disable interrupts while reading time... - call joy_get_timer ; Returns counter in EAX - sti ; enable interrupts after reading time... - mov dword [LastTick], eax - -waitforstable_f: in al, dx - and al, bl - jz ready_f ; Wait for the port in question to be done reading... - - cli ; disable interrupts while reading time... - call joy_get_timer ; Returns counter in EAX - sti ; enable interrupts after reading time... - xchg eax, dword [LastTick] - cmp eax, dword [LastTick] - jb @@f2 - sub eax, dword [LastTick] -@@f2: ; Higher... - add dword [TotalTicks], eax - cmp dword [TotalTicks], ecx ; Timeout at 1/200'th of a second - jae ready_f - jmp waitforstable_f - -ready_f: - cli - mov al, 0ffh - out dx, al ; Start joystick a readin' - - call joy_get_timer ; Returns counter in EAX - mov dword [LastTick], eax - mov dword [TotalTicks], 0 - - mov [edi], eax ; Store initial count - add edi, 4 - -again_f: in al, dx ; Read Joystick port - not al - and al, bl ; Mask off channels we don't want to read - jnz flip_f ; See if any of the channels flipped - - ; none flipped -- check any interrupts... - mov al, 0Ah - out 20h, al - in al, 20h ; Get interrupts pending - cmp al, 0 - je NoInts - - ; Need to do an interrupt - sti - nop ; let the interrupt go on... - cli - - ; See if any axis turned - in al, dx - not al - and al, bl - jz NoInts - - ; At this point, an interrupt occured, making one or more - ; of the axis values bogus. So, we will restart this process... - - pop edi - pop ebx - pop ecx - - jmp _joy_read_stick_friendly_retry - -NoInts: - call joy_get_timer ; Returns counter in EAX - - xchg eax, dword [LastTick] - cmp eax, dword [LastTick] - jb @@f3 - sub eax, dword [LastTick] -@@f3: ; Higher... - add dword [TotalTicks], eax - cmp dword [TotalTicks], ecx ; Timeout at 1/200'th of a second - jae timed_out_f - jmp again_f - - flip_f: and eax, 01111b ; Only care about axis values - mov [edi], eax ; Record what channel(s) flipped - add edi, 4 - xor bl, al ; Unmark the channels that just tripped - - call joy_get_timer ; Returns counter in EAX - mov [edi], eax ; Record the time this channel flipped - add edi, 4 - inc bh ; Increment number of events - - cmp bl, 0 - jne again_f ; If there are more channels to read, keep looping - - timed_out_f: - sti - - movzx eax, bh ; Return number of events - - pop edi - pop ebx - pop ecx - - pop edi - pop ebx - ret - - - -global _joy_read_stick_asm2 - -_joy_read_stick_asm2: - push ebx - push edi - - mov ebx,[esp+12] - mov edi,[esp+16] - mov ecx,[esp+20] - - ; ebx = read mask - ; edi = pointer to event buffer - ; ecx = timeout value - ; returns in eax the number of events - mov dword [_joy_bogus_reading], 0 - - and ebx, 01111b ; Make sure we only check the right values - ; number of events we found will be in bh, so this also clears it to zero. - - mov dx, [_JOY_PORT] - - cli ; disable interrupts while reading time... - call joy_get_timer ; Returns counter in EAX - sti ; enable interrupts after reading time... - mov dword [LastTick], eax - -waitforstable: in al, dx - and al, bl - jz ready ; Wait for the port in question to be done reading... - - cli ; disable interrupts while reading time... - call joy_get_timer ; Returns counter in EAX - sti ; enable interrupts after reading time... - xchg eax, dword [LastTick] - cmp eax, dword [LastTick] - jb @@f4 - sub eax, dword [LastTick] -@@f4: ; Higher... - add dword [TotalTicks], eax - cmp dword [TotalTicks], ecx ; Timeout at 1/200'th of a second - jae ready - jmp waitforstable - -ready: - cli - mov al, 0ffh - out dx, al ; Start joystick a readin' - - call joy_get_timer ; Returns counter in EAX - mov dword [LastTick], eax - mov dword [TotalTicks], 0 - - mov [edi], eax ; Store initial count - add edi, 4 - - again: in al, dx ; Read Joystick port - not al - and al, bl ; Mask off channels we don't want to read - jnz flip ; See if any of the channels flipped - - call joy_get_timer ; Returns counter in EAX - - xchg eax, dword [LastTick] - cmp eax, dword [LastTick] - jb @@f5 - sub eax, dword [LastTick] -@@f5: ; Higher... - add dword [TotalTicks], eax - cmp dword [TotalTicks], ecx ; Timeout at 1/200'th of a second - jae timedout - jmp again - - flip: and eax, 01111b ; Only care about axis values - mov [edi], eax ; Record what channel(s) flipped - add edi, 4 - xor bl, al ; Unmark the channels that just tripped - - call joy_get_timer ; Returns counter in EAX - mov [edi], eax ; Record the time this channel flipped - add edi, 4 - inc bh ; Increment number of events - - cmp bl, 0 - jne again ; If there are more channels to read, keep looping - - timedout: - movzx eax, bh ; Return number of events - - sti - pop edi - pop ebx - ret - - -global _joy_read_stick_polled2 - -_joy_read_stick_polled2: - push ebx - push edi - - mov ebx,[esp+12] - mov edi,[esp+16] - mov ecx,[esp+20] - - ; ebx = read mask - ; edi = pointer to event buffer - ; ecx = timeout value - ; returns in eax the number of events - mov dword [_joy_bogus_reading], 0 - - and ebx, 01111b ; Make sure we only check the right values - ; number of events we found will be in bh, so this also clears it to zero. - - mov dx, [_JOY_PORT] - - mov dword [TotalTicks], 0 - -waitforstable1: in al, dx - and al, bl - jz ready1 ; Wait for the port in question to be done reading... - - inc dword [TotalTicks] - cmp dword [TotalTicks], ecx ; Timeout at 1/200'th of a second - jae ready1 - jmp waitforstable1 -ready1: - cli - mov al, 0ffh - out dx, al ; Start joystick a readin' - - mov dword [TotalTicks], 0 - - mov dword [edi], 0 ; Store initial count - add edi, 4 - - again1: in al, dx ; Read Joystick port - not al - and al, bl ; Mask off channels we don't want to read - jnz flip1 ; See if any of the channels flipped - - inc dword [TotalTicks] - cmp dword [TotalTicks], ecx ; Timeout at 1/200'th of a second - jae timedout1 - jmp again1 - - flip1: and eax, 01111b ; Only care about axis values - mov [edi], eax ; Record what channel(s) flipped - add edi, 4 - xor bl, al ; Unmark the channels that just tripped - - mov eax, dword [TotalTicks] - mov [edi], eax ; Record the time this channel flipped - add edi, 4 - inc bh ; Increment number of events - - cmp bl, 0 - jne again1 ; If there are more channels to read, keep looping - - timedout1: - movzx eax, bh ; Return number of events - - sti - pop edi - pop ebx - ret - -global _joy_read_stick_bios2 - -_joy_read_stick_bios2: - push ebx - push edi - - mov ebx,[esp+12] - mov edi,[esp+16] - mov ecx,[esp+20] - ; ebx = read mask - ; edi = pointer to event buffer - ; ecx = timeout value - ; returns in eax the number of events - - mov dword [_joy_bogus_reading], 0 - - pusha - - mov dword [edi], 0 - - mov eax, 08400h - mov edx, 1 - cli - int 15h - sti - - mov dword [edi+4], 1 ; Axis 1 - and eax, 0ffffh - mov [edi+8], eax ; Axis 1 value - - mov dword [edi+12], 2 ; Axis 2 - and ebx, 0ffffh - mov [edi+16], ebx ; Axis 2 value - - mov dword [edi+20], 4 ; Axis 3 - and ecx, 0ffffh - mov [edi+24], ecx ; Axis 3 value - - mov dword [edi+28], 8 ; Axis 3 - and edx, 0ffffh - mov [edi+32], edx ; Axis 3 value - - popa - mov eax, 4 ; 4 events - - pop edi - pop ebx - ret - - -global _joy_read_buttons_bios2 - -_joy_read_buttons_bios2: - ; returns in eax the button settings - - push ebx - push ecx - push edx - mov eax, 08400h - mov edx, 0 ; Read switches - int 15h - pop edx - pop ecx - pop ebx - - shr eax, 4 - not eax - and eax, 01111b - ret -global _joy_read_buttons_bios_end2 -_joy_read_buttons_bios_end2: ; to calculate _joy_read_buttons_bios size - diff --git a/arch/dos/joyc.c b/arch/dos/joyc.c deleted file mode 100644 index 410e7a32..00000000 --- a/arch/dos/joyc.c +++ /dev/null @@ -1,799 +0,0 @@ -/* -THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -*/ -/* - * $Source: /cvs/cvsroot/d2x/arch/dos/joyc.c,v $ - * $Revision: 1.1.1.2 $ - * $Author: bradleyb $ - * $Date: 2001-01-19 03:33:52 $ - * - * Routines for joystick reading. - * - * $Log: not supported by cvs2svn $ - * Revision 1.1.1.1 1999/06/14 21:58:26 donut - * Import of d1x 1.37 source. - * - * Revision 1.37 1995/10/07 13:22:31 john - * Added new method of reading joystick that allows higher-priority - * interrupts to go off. - * - * Revision 1.36 1995/03/30 11:03:40 john - * Made -JoyBios read buttons using BIOS. - * - * Revision 1.35 1995/02/14 11:39:25 john - * Added polled/bios joystick readers.. - * - * Revision 1.34 1995/02/10 17:06:12 john - * Fixed bug with plugging in a joystick not getting detected. - * - * Revision 1.33 1995/01/27 16:39:42 john - * Made so that if no joystick detected, it wont't - * read buttons. - * - * Revision 1.32 1995/01/12 13:16:40 john - * Made it so that joystick can't lose an axis - * by 1 weird reading. Reading has to occurr during - * calibration for this to happen. - * - * Revision 1.31 1994/12/28 15:56:03 john - * Fixed bug that refused to read joysticks whose - * min,cen,max were less than 100 apart. - * - * Revision 1.30 1994/12/28 15:31:53 john - * Added code to read joystick axis not all at one time. - * - * Revision 1.29 1994/12/27 15:44:36 john - * Made the joystick timeout be at 1/100th of a second, - * regardless of CPU speed. - * - * Revision 1.28 1994/12/04 11:54:54 john - * Made stick read at whatever rate the clock is at, not - * at 18.2 times/second. - * - * Revision 1.27 1994/11/29 02:25:40 john - * Made it so that the scaled reading returns 0 - * if the calibration factors look funny.. - * - * Revision 1.26 1994/11/22 11:08:07 john - * Commented out the ARCADE joystick. - * - * Revision 1.25 1994/11/14 19:40:26 john - * Fixed bug with no joystick being detected. - * - * Revision 1.24 1994/11/14 19:36:40 john - * Took out initial cheapy calibration. - * - * Revision 1.23 1994/11/14 19:13:27 john - * Took out the calibration in joy_init - * - * Revision 1.22 1994/10/17 10:09:57 john - * Made the state look at last_State, so that a joy_flush - * doesn't cause a new down state to be added next reading. - * - * Revision 1.21 1994/10/13 11:36:23 john - * Made joy_down_time be kept track of in fixed seconds, - * not ticks. - * - * Revision 1.20 1994/10/12 16:58:50 john - * Fixed bug w/ previous comment. - * - * Revision 1.19 1994/10/12 16:57:44 john - * Added function to set a joystick button's state. - * - * Revision 1.18 1994/10/11 10:20:13 john - * Fixed Flightstick Pro/ - * .. - * - * Revision 1.17 1994/09/29 18:29:20 john - * *** empty log message *** - * - * Revision 1.16 1994/09/27 19:17:23 john - * Added code so that is joy_init is never called, joystick is not - * used at all. - * - * Revision 1.15 1994/09/22 16:09:23 john - * Fixed some virtual memory lockdown problems with timer and - * joystick. - * - * Revision 1.14 1994/09/16 11:44:42 john - * Fixed bug with slow joystick. - * - * Revision 1.13 1994/09/16 11:36:15 john - * Fixed bug with reading non-present channels. - * - * Revision 1.12 1994/09/15 20:52:48 john - * rme john - * Added support for the Arcade style joystick. - * - * Revision 1.11 1994/09/13 20:04:49 john - * Fixed bug with joystick button down_time. - * - * Revision 1.10 1994/09/10 13:48:07 john - * Made all 20 buttons read. - * - * Revision 1.9 1994/08/31 09:55:02 john - * *** empty log message *** - * - * Revision 1.8 1994/08/29 21:02:14 john - * Added joy_set_cal_values... - * - * Revision 1.7 1994/08/29 20:52:17 john - * Added better cyberman support; also, joystick calibration - * value return funcctiionn, - * - * Revision 1.6 1994/08/24 18:53:12 john - * Made Cyberman read like normal mouse; added dpmi module; moved - * mouse from assembly to c. Made mouse buttons return time_down. - * - * Revision 1.5 1994/07/14 22:12:23 john - * Used intrinsic forms of outp to fix vmm error. - * - * Revision 1.4 1994/07/07 19:52:59 matt - * Made joy_init() return success/fail flag - * Made joy_init() properly detect a stick if one is plugged in after joy_init() - * was called the first time. - * - * Revision 1.3 1994/07/01 10:55:55 john - * Fixed some bugs... added support for 4 axis. - * - * Revision 1.2 1994/06/30 20:36:55 john - * Revamped joystick code. - * - * Revision 1.1 1994/06/30 15:42:15 john - * Initial revision - * - * - */ - - -#include - -#include -#include -#include - -//#define ARCADE 1 - -#include "pstypes.h" -#include "mono.h" -#include "joy.h" -#include "u_dpmi.h" -#include "timer.h" - -#include "args.h" - -extern int joy_bogus_reading; -int JOY_PORT = 513; //201h; -int joy_deadzone = 0; - -int joy_read_stick_asm2( int read_masks, int * event_buffer, int timeout ); -int joy_read_stick_friendly2( int read_masks, int * event_buffer, int timeout ); -int joy_read_stick_polled2( int read_masks, int * event_buffer, int timeout ); -int joy_read_stick_bios2( int read_masks, int * event_buffer, int timeout ); -int joy_read_buttons_bios2(); -void joy_read_buttons_bios_end2(); - - -//In key.c -// ebx = read mask -// edi = pointer to buffer -// returns number of events - -char joy_installed = 0; -char joy_present = 0; - -typedef struct Button_info { - ubyte ignore; - ubyte state; - ubyte last_state; - int timedown; - ubyte downcount; - ubyte upcount; -} Button_info; - -typedef struct Joy_info { - ubyte present_mask; - ubyte slow_read; - int max_timer; - int read_count; - ubyte last_value; - Button_info buttons[MAX_BUTTONS]; - int axis_min[4]; - int axis_center[4]; - int axis_max[4]; -} Joy_info; - -Joy_info joystick; - -ubyte joy_read_buttons() -{ - return ((~(inp(JOY_PORT) >> 4))&0xf); -} - -void joy_get_cal_vals(int *axis_min, int *axis_center, int *axis_max) -{ - int i; - - for (i=0; i<4; i++) { - axis_min[i] = joystick.axis_min[i]; - axis_center[i] = joystick.axis_center[i]; - axis_max[i] = joystick.axis_max[i]; - } -} - -void joy_set_cal_vals(int *axis_min, int *axis_center, int *axis_max) -{ - int i; - - for (i=0; i<4; i++) { - joystick.axis_min[i] = axis_min[i]; - joystick.axis_center[i] = axis_center[i]; - joystick.axis_max[i] = axis_max[i]; - } -} - - -ubyte joy_get_present_mask() { - return joystick.present_mask; -} - -void joy_set_timer_rate(int max_value ) { - _disable(); - joystick.max_timer = max_value; - _enable(); -} - -int joy_get_timer_rate() { - return joystick.max_timer; -} - - -void joy_flush() { - int i; - - if (!joy_installed) return; - - _disable(); - for (i=0; i 7 ) { - joystick.read_count = 0; - value = joy_read_buttons_bios2(); - joystick.last_value = value; - } else { - value = joystick.last_value; - } - } else { - value = joy_read_buttons(); //JOY_READ_BUTTONS; - } - - for (i=0; iignore) { - if ( i < 5 ) - state = (value >> i) & 1; - else if (i==(value+4)) - state = 1; - else - state = 0; - - if ( button->last_state == state ) { - if (state) button->timedown += ticks_this_time; - } else { - if (state) { - button->downcount += state; - button->state = 1; - } else { - button->upcount += button->state; - button->state = 0; - } - button->last_state = state; - } - } - } -} - -void joy_handler_end() { // Dummy function to help calculate size of joystick handler function -} - -#pragma off (check_stack) - -ubyte joy_read_raw_buttons() { - if ( joystick.slow_read & JOY_BIOS_READINGS ) - return joy_read_buttons_bios2(); - else - return joy_read_buttons(); //JOY_READ_BUTTONS; -} - -void joy_set_slow_reading(int flag) -{ - joystick.slow_read |= flag; - joy_set_cen(); -} - -ubyte joystick_read_raw_axis( ubyte mask, int * axis ) -{ - ubyte read_masks, org_masks; - int t, t1, t2, buffer[4*2+2]; - int e, i, num_channels, c; - - axis[0] = 0; axis[1] = 0; - axis[2] = 0; axis[3] = 0; - - if (!joy_installed) return 0; - - read_masks = 0; - org_masks = mask; - - mask &= joystick.present_mask; // Don't read non-present channels - if ( mask==0 ) { - return 0; // Don't read if no stick connected. - } - - if ( joystick.slow_read & JOY_SLOW_READINGS ) { - for (c=0; c<4; c++ ) { - if ( mask & (1 << c)) { - // Time out at (1/100th of a second) - - if ( joystick.slow_read & JOY_POLLED_READINGS ) - num_channels = joy_read_stick_polled2( (1 << c), buffer, 65536 ); - else if ( joystick.slow_read & JOY_BIOS_READINGS ) - num_channels = joy_read_stick_bios2( (1 << c), buffer, 65536 ); - else if ( joystick.slow_read & JOY_FRIENDLY_READINGS ) - num_channels = joy_read_stick_friendly2( (1 << c), buffer, (1193180/100) ); - else - num_channels = joy_read_stick_asm2( (1 << c), buffer, (1193180/100) ); - - if ( num_channels > 0 ) { - t1 = buffer[0]; - e = buffer[1]; - t2 = buffer[2]; - if ( joystick.slow_read & (JOY_POLLED_READINGS|JOY_BIOS_READINGS) ) { - t = t2 - t1; - } else { - if ( t1 > t2 ) - t = t1 - t2; - else { - t = t1 + joystick.max_timer - t2; - //mprintf( 0, "%d, %d, %d, %d\n", t1, t2, joystick.max_timer, t ); - } - } - - if ( e & 1 ) { axis[0] = t; read_masks |= 1; } - if ( e & 2 ) { axis[1] = t; read_masks |= 2; } - if ( e & 4 ) { axis[2] = t; read_masks |= 4; } - if ( e & 8 ) { axis[3] = t; read_masks |= 8; } - } - } - } - } else { - // Time out at (1/100th of a second) - if ( joystick.slow_read & JOY_POLLED_READINGS ) - num_channels = joy_read_stick_polled2( mask, buffer, 65536 ); - else if ( joystick.slow_read & JOY_BIOS_READINGS ) - num_channels = joy_read_stick_bios2( mask, buffer, 65536 ); - else if ( joystick.slow_read & JOY_FRIENDLY_READINGS ) - num_channels = joy_read_stick_friendly2( mask, buffer, (1193180/100) ); - else - num_channels = joy_read_stick_asm2( mask, buffer, (1193180/100) ); - //mprintf(( 0, "(%d)\n", num_channels )); - - for (i=0; i t2 ) - t = t1 - t2; - else { - t = t1 + joystick.max_timer - t2; - //mprintf(( 0, "%d, %d, %d, %d\n", t1, t2, joystick.max_timer, t )); - } - } - e = buffer[i*2+1]; - - if ( e & 1 ) { axis[0] = t; read_masks |= 1; } - if ( e & 2 ) { axis[1] = t; read_masks |= 2; } - if ( e & 4 ) { axis[2] = t; read_masks |= 4; } - if ( e & 8 ) { axis[3] = t; read_masks |= 8; } - } - - } - - return read_masks; -} - -#ifdef __GNUC__ -#define near -#endif - -int joy_init() -{ - int i; - int temp_axis[4]; - -// if(args_find("-joy209")) -// use_alt_joyport=1; - if(args_find("-joy209")) - JOY_PORT = 521; //209h; - - joy_flush(); - - _disable(); - for (i=0; i 127 ) - x = 127; - -//added on 4/13/99 by Victor Rachels to add deadzone control - dz = (joy_deadzone) * 6; - if ((x > (-1*dz)) && (x < dz)) - x = 0; -//end this section addition -VR - - return x; -} - -int last_reading[4] = { 0, 0, 0, 0 }; - -void joy_get_pos( int *x, int *y ) -{ - ubyte flags; - int axis[4]; - - if ((!joy_installed)||(!joy_present)) { *x=*y=0; return; } - - flags=joystick_read_raw_axis( JOY_1_X_AXIS+JOY_1_Y_AXIS, axis ); - - if ( joy_bogus_reading ) { - axis[0] = last_reading[0]; - axis[1] = last_reading[1]; - flags = JOY_1_X_AXIS+JOY_1_Y_AXIS; - } else { - last_reading[0] = axis[0]; - last_reading[1] = axis[1]; - } - - if ( flags & JOY_1_X_AXIS ) - *x = joy_get_scaled_reading( axis[0], 0 ); - else - *x = 0; - - if ( flags & JOY_1_Y_AXIS ) - *y = joy_get_scaled_reading( axis[1], 1 ); - else - *y = 0; -} - -ubyte joy_read_stick( ubyte masks, int *axis ) -{ - ubyte flags; - int raw_axis[4]; - - if ((!joy_installed)||(!joy_present)) { - axis[0] = 0; axis[1] = 0; - axis[2] = 0; axis[3] = 0; - return 0; - } - - flags=joystick_read_raw_axis( masks, raw_axis ); - - if ( joy_bogus_reading ) { - axis[0] = last_reading[0]; - axis[1] = last_reading[1]; - axis[2] = last_reading[2]; - axis[3] = last_reading[3]; - flags = masks; - } else { - last_reading[0] = axis[0]; - last_reading[1] = axis[1]; - last_reading[2] = axis[2]; - last_reading[3] = axis[3]; - } - - if ( flags & JOY_1_X_AXIS ) - axis[0] = joy_get_scaled_reading( raw_axis[0], 0 ); - else - axis[0] = 0; - - if ( flags & JOY_1_Y_AXIS ) - axis[1] = joy_get_scaled_reading( raw_axis[1], 1 ); - else - axis[1] = 0; - - if ( flags & JOY_2_X_AXIS ) - axis[2] = joy_get_scaled_reading( raw_axis[2], 2 ); - else - axis[2] = 0; - - if ( flags & JOY_2_Y_AXIS ) - axis[3] = joy_get_scaled_reading( raw_axis[3], 3 ); - else - axis[3] = 0; - - return flags; -} - - -int joy_get_btns() -{ - if ((!joy_installed)||(!joy_present)) return 0; - - return joy_read_raw_buttons(); -} - -void joy_get_btn_down_cnt( int *btn0, int *btn1 ) -{ - if ((!joy_installed)||(!joy_present)) { *btn0=*btn1=0; return; } - - _disable(); - *btn0 = joystick.buttons[0].downcount; - joystick.buttons[0].downcount = 0; - *btn1 = joystick.buttons[1].downcount; - joystick.buttons[1].downcount = 0; - _enable(); -} - -int joy_get_button_state( int btn ) -{ - int count; - - if ((!joy_installed)||(!joy_present)) return 0; - - if ( btn >= MAX_BUTTONS ) return 0; - - _disable(); - count = joystick.buttons[btn].state; - _enable(); - - return count; -} - -int joy_get_button_up_cnt( int btn ) -{ - int count; - - if ((!joy_installed)||(!joy_present)) return 0; - - if ( btn >= MAX_BUTTONS ) return 0; - - _disable(); - count = joystick.buttons[btn].upcount; - joystick.buttons[btn].upcount = 0; - _enable(); - - return count; -} - -int joy_get_button_down_cnt( int btn ) -{ - int count; - - if ((!joy_installed)||(!joy_present)) return 0; - if ( btn >= MAX_BUTTONS ) return 0; - - _disable(); - count = joystick.buttons[btn].downcount; - joystick.buttons[btn].downcount = 0; - _enable(); - - return count; -} - - -fix joy_get_button_down_time( int btn ) -{ - fix count; - - if ((!joy_installed)||(!joy_present)) return 0; - if ( btn >= MAX_BUTTONS ) return 0; - - _disable(); - count = joystick.buttons[btn].timedown; - joystick.buttons[btn].timedown = 0; - _enable(); - - return fixmuldiv(count, 65536, 1193180 ); -} - -void joy_get_btn_up_cnt( int *btn0, int *btn1 ) -{ - if ((!joy_installed)||(!joy_present)) { *btn0=*btn1=0; return; } - - _disable(); - *btn0 = joystick.buttons[0].upcount; - joystick.buttons[0].upcount = 0; - *btn1 = joystick.buttons[1].upcount; - joystick.buttons[1].upcount = 0; - _enable(); -} - -void joy_set_btn_values( int btn, int state, fix timedown, int downcount, int upcount ) -{ - _disable(); - joystick.buttons[btn].ignore = 1; - joystick.buttons[btn].state = state; - joystick.buttons[btn].timedown = fixmuldiv( timedown, 1193180, 65536 ); - joystick.buttons[btn].downcount = downcount; - joystick.buttons[btn].upcount = upcount; - _enable(); -} - -void joy_poll() -{ - if ( joystick.slow_read & JOY_BIOS_READINGS ) - joystick.last_value = joy_read_buttons_bios2(); -} diff --git a/arch/dos/joydefs.c b/arch/dos/joydefs.c deleted file mode 100644 index 4444f148..00000000 --- a/arch/dos/joydefs.c +++ /dev/null @@ -1,673 +0,0 @@ -/* -THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -*/ -/* - * $Source: /cvs/cvsroot/d2x/arch/dos/joydefs.c,v $ - * $Revision: 1.1.1.2 $ - * $Author: bradleyb $ - * $Date: 2001-01-19 03:33:52 $ - * - * . - * - * $Log: not supported by cvs2svn $ - * Revision 1.1.1.1 1999/06/14 21:58:29 donut - * Import of d1x 1.37 source. - * - * Revision 2.2 1995/06/30 12:30:22 john - * Added -Xname command line. - * - * Revision 2.1 1995/04/06 12:13:20 john - * Made so you can calibrate Gravis Gamepad. - * - * Revision 2.0 1995/02/27 11:30:27 john - * New version 2.0, which has no anonymous unions, builds with - * Watcom 10.0, and doesn't require parsing BITMAPS.TBL. - * - * Revision 1.71 1995/02/12 02:06:10 john - * Fixed bug with joystick incorrectly asking for - * calibration. - * - * Revision 1.70 1995/01/28 15:58:07 john - * Made joystick calibration be only when wrong detected in - * menu or joystick axis changed. - * - * Revision 1.69 1995/01/25 14:37:55 john - * Made joystick only prompt for calibration once... - * - * Revision 1.68 1995/01/24 16:34:29 john - * Made so that if you reconfigure joystick and - * add or subtract an axis, it asks for a recalibration - * upon leaving. - * - * Revision 1.67 1994/12/29 11:08:51 john - * Fixed Thrustmaster and Logitech Wingman extreme - * Hat by reading the y2 axis during the center stage - * of the calibration, and using 75, 50, 27, and 3 % - * as values for the 4 positions. - * - * Revision 1.66 1994/12/15 18:17:39 john - * Fixed warning with previous. - * - * Revision 1.65 1994/12/15 18:15:48 john - * Made the joy cal only write the .cfg file, not - * the player file. - * - * Revision 1.64 1994/12/13 14:43:35 john - * Took out the code in kconfig to build direction array. - * Called kc_set_controls after selecting a new control type. - * - * Revision 1.63 1994/12/10 12:08:47 john - * Changed some delays to use TICKER instead of timer_get_fixed_seconds. - * - * Revision 1.62 1994/12/09 11:01:07 mike - * force calibration of joystick on joystick selection from Controls... menu. - * - * Revision 1.61 1994/12/07 21:50:27 john - * Put stop/start time around joystick delay. - * - * Revision 1.60 1994/12/07 19:34:39 john - * Added delay. - * - * Revision 1.59 1994/12/07 18:12:14 john - * NEatened up joy cal., - * - * Revision 1.58 1994/12/07 17:07:51 john - * Fixed up joy cal. - * - * Revision 1.57 1994/12/07 16:48:53 yuan - * localization - * - * Revision 1.56 1994/12/07 16:05:55 john - * Changed the way joystick calibration works. - * - * Revision 1.55 1994/12/06 20:15:22 john - * Took out code that unpauses songs that were never paused. - * - * Revision 1.54 1994/12/06 15:14:09 yuan - * Localization - * - * Revision 1.53 1994/12/05 16:29:16 john - * Took out music pause around the cheat menu. - * - * Revision 1.52 1994/12/04 12:39:10 john - * MAde so that FCS calibration doesn't ask for axis #2. - * - * Revision 1.51 1994/12/03 15:14:59 john - * Took out the delay mentioned previosuly cause it would - * cause bigger problems than it helps, especially with netgames. - * - * Revision 1.50 1994/12/03 14:16:14 john - * Put a delay between screens in joy cal to keep Yuan from - * double hitting. - * - * Revision 1.49 1994/12/03 11:04:06 john - * Changed newmenu code a bit to fix bug with bogus - * backgrounds occcasionally. - * - * Revision 1.48 1994/12/02 11:03:44 yuan - * Localization. - * - * Revision 1.47 1994/12/02 10:50:33 yuan - * Localization - * - * Revision 1.46 1994/12/01 12:21:59 john - * Added code to calibrate 2 joysticks separately. - * - * Revision 1.45 1994/12/01 11:52:31 john - * Added message when you select FCS to say that if - * you have WCS, see manuel. - * - * Revision 1.44 1994/11/29 02:26:28 john - * Made the prompts for upper-left, lower right for joy - * calibration more obvious. - * - * Revision 1.43 1994/11/26 13:13:59 matt - * Changed "none" option to "keyboard only" - * - * Revision 1.42 1994/11/21 19:35:13 john - * Replaced calls to joy_init with if (joy_present) - * - * Revision 1.41 1994/11/21 19:28:34 john - * Changed warning for no joystick to use nm_messagebox.. - * - * Revision 1.40 1994/11/21 19:06:25 john - * Made it so that it only stops sound when your in game mode. - * - * Revision 1.39 1994/11/21 11:47:18 john - * Made sound pause during joystick calibration. - * - * Revision 1.38 1994/11/10 20:34:18 rob - * Removed menu-specific network mode support in favor in new stuff - * in newmenu.c - * - * Revision 1.37 1994/11/08 21:21:38 john - * Made Esc exit joystick calibration. - * - * Revision 1.36 1994/11/08 15:14:42 john - * Added more calls so net doesn't die in net game. - * - * Revision 1.35 1994/11/08 14:59:12 john - * Added code to respond to network while in menus. - * - * Revision 1.34 1994/10/24 19:56:32 john - * Made the new user setup prompt for config options. - * - * Revision 1.33 1994/10/22 14:11:52 mike - * Suppress compiler warning message. - * - * Revision 1.32 1994/10/19 12:44:24 john - * Added hours field to player structure. - * - * Revision 1.31 1994/10/17 13:07:13 john - * Moved the descent.cfg info into the player config file. - * - * Revision 1.30 1994/10/13 21:41:12 john - * MAde Esc exit out of joystick calibration. - * - * Revision 1.29 1994/10/13 19:22:27 john - * Added separate config saves for different devices. - * Made all the devices work together better, such as mice won't - * get read when you're playing with the joystick. - * - * Revision 1.28 1994/10/13 11:40:18 john - * Took out warnings. - * - * Revision 1.27 1994/10/13 11:35:23 john - * Made Thrustmaster FCS Hat work. Put a background behind the - * keyboard configure. Took out turn_sensitivity. Changed sound/config - * menu to new menu. Made F6 be calibrate joystick. - * - * Revision 1.26 1994/10/11 21:29:03 matt - * Made a bunch of menus have good initial selected values - * - * Revision 1.25 1994/10/11 17:08:39 john - * Added sliders for volume controls. - * - * Revision 1.24 1994/10/10 17:59:21 john - * Neatend previous. - * - * Revision 1.23 1994/10/10 17:57:59 john - * Neatend previous. - * - * Revision 1.22 1994/10/10 17:56:11 john - * Added messagebox that tells that config has been saved. - * - * Revision 1.21 1994/09/30 12:37:26 john - * Added midi,digi volume to configuration. - * - * Revision 1.20 1994/09/22 16:14:14 john - * Redid intro sequecing. - * - * Revision 1.19 1994/09/19 18:50:15 john - * Added switch to disable joystick. - * - * Revision 1.18 1994/09/12 11:47:36 john - * Made stupid cruise work better. Make kconfig values get - * read/written to disk. - * - * Revision 1.17 1994/09/10 15:46:47 john - * First version of new keyboard configuration. - * - * Revision 1.16 1994/09/06 19:35:44 john - * Fixed bug that didn';t load new size .cal file. - * - * Revision 1.15 1994/09/06 14:51:58 john - * Added sensitivity adjustment, fixed bug with joystick button not - * staying down. - * - * Revision 1.14 1994/09/02 16:13:47 john - * Made keys fill in position. - * - * Revision 1.13 1994/08/31 17:58:50 john - * Made a bit simpler. - * - * Revision 1.12 1994/08/31 14:17:54 john - * *** empty log message *** - * - * Revision 1.11 1994/08/31 14:10:56 john - * Made keys not work when KEY_DELETE pressed. - * - * Revision 1.10 1994/08/31 13:40:47 mike - * Change constant - * - * Revision 1.9 1994/08/31 12:56:27 john - * *** empty log message *** - * - * Revision 1.8 1994/08/30 20:38:29 john - * Add more config stuff.. - * - * Revision 1.7 1994/08/30 16:37:25 john - * Added menu options to set controls. - * - * Revision 1.6 1994/08/30 09:27:18 john - * *** empty log message *** - * - * Revision 1.5 1994/08/30 09:12:01 john - * *** empty log message *** - * - * Revision 1.4 1994/08/29 21:18:32 john - * First version of new keyboard/oystick remapping stuff. - * - * Revision 1.3 1994/08/24 19:00:29 john - * Changed key_down_time to return fixed seconds instead of - * milliseconds. - * - * Revision 1.2 1994/08/17 16:50:37 john - * Added damaging fireballs, missiles. - * - * Revision 1.1 1994/08/17 10:07:12 john - * Initial revision - * - * - */ - -#include - -#include -#include -#include - -#include "mono.h" -#include "key.h" -#include "joy.h" -#include "timer.h" -#include "error.h" - -#include "inferno.h" -#include "game.h" -#include "object.h" -#include "player.h" - -#include "controls.h" -#include "joydefs.h" -#include "render.h" -#include "palette.h" -#include "newmenu.h" -#include "args.h" -#include "text.h" -#include "kconfig.h" -#include "digi.h" -#include "playsave.h" - -int joydefs_calibrate_flag = 0; - -int Joy_is_Sidewinder = 0; - -void joy_delay() -{ -#ifdef __MSDOS__ - int t1 = TICKER + 19/4; // Wait 1/4 second... - stop_time(); - while( TICKER < t1 ); - joy_flush(); - start_time(); -#endif -} - - -int joycal_message( char * title, char * text ) -{ - int i; - newmenu_item m[2]; - m[0].type = NM_TYPE_TEXT; m[0].text = text; - m[1].type = NM_TYPE_MENU; m[1].text = TXT_OK; - i = newmenu_do( title, NULL, 2, m, NULL ); - if ( i < 0 ) - return 1; - return 0; -} - -extern int WriteConfigFile(); - -void joydefs_calibrate() -{ - ubyte masks; - int org_axis_min[4]; - int org_axis_center[4]; - int org_axis_max[4]; - - int axis_min[4] = { 0, 0, 0, 0 }; - int axis_cen[4] = { 0, 0, 0, 0 }; - int axis_max[4] = { 0, 0, 0, 0 }; - - int temp_values[4]; - char title[50]; - char text[50]; - int nsticks = 0; - - joydefs_calibrate_flag = 0; - - if ( (Config_control_type!=CONTROL_JOYSTICK) && (Config_control_type!=CONTROL_FLIGHTSTICK_PRO) && (Config_control_type!=CONTROL_THRUSTMASTER_FCS) && (Config_control_type!=CONTROL_GRAVIS_GAMEPAD) ) - return; - - joy_get_cal_vals(org_axis_min, org_axis_center, org_axis_max); - - joy_set_cen(); - joystick_read_raw_axis( JOY_ALL_AXIS, temp_values ); - - if (!joy_present) { - nm_messagebox( NULL, 1, TXT_OK, TXT_NO_JOYSTICK ); - return; - } - - masks = joy_get_present_mask(); - - if ( masks == JOY_ALL_AXIS ) - nsticks = 2; - else - nsticks = 1; - - if ( nsticks == 2 && !Joy_is_Sidewinder) { - sprintf( title, "%s #1\n%s", TXT_JOYSTICK, TXT_UPPER_LEFT); - sprintf( text, "%s #1 %s", TXT_MOVE_JOYSTICK, TXT_TO_UL); - } else { - sprintf( title, "%s\n%s", TXT_JOYSTICK, TXT_UPPER_LEFT); - sprintf( text, "%s %s", TXT_MOVE_JOYSTICK, TXT_TO_UL); - } - if (joycal_message( title, text )) { - joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max); - return; - } - joystick_read_raw_axis( JOY_ALL_AXIS, temp_values ); - axis_min[0] = temp_values[0]; - axis_min[1] = temp_values[1]; - joy_delay(); - - if ( nsticks == 2 && !Joy_is_Sidewinder) { - sprintf( title, "%s #1\n%s", TXT_JOYSTICK, TXT_LOWER_RIGHT); - sprintf( text, "%s #1 %s", TXT_MOVE_JOYSTICK, TXT_TO_LR); - } else { - sprintf( title, "%s\n%s", TXT_JOYSTICK, TXT_LOWER_RIGHT); - sprintf( text, "%s %s", TXT_MOVE_JOYSTICK, TXT_TO_LR); - } - if (joycal_message( title, text)) { - joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max); - return; - } - joystick_read_raw_axis( JOY_ALL_AXIS, temp_values ); - axis_max[0] = temp_values[0]; - axis_max[1] = temp_values[1]; - joy_delay(); - - if ( nsticks == 2 && !Joy_is_Sidewinder) { - sprintf( title, "%s #1\n%s", TXT_JOYSTICK, TXT_CENTER); - sprintf( text, "%s #1 %s", TXT_MOVE_JOYSTICK, TXT_TO_C); - } else { - sprintf( title, "%s\n%s", TXT_JOYSTICK, TXT_CENTER); - sprintf( text, "%s %s", TXT_MOVE_JOYSTICK, TXT_TO_C); - } - if (joycal_message( title, text)) { - joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max); - return; - } - joystick_read_raw_axis( JOY_ALL_AXIS, temp_values ); - axis_cen[0] = temp_values[0]; - axis_cen[1] = temp_values[1]; - joy_delay(); - - // The fcs uses axes 3 for hat, so don't calibrate it. - if (Config_control_type == CONTROL_THRUSTMASTER_FCS) { - axis_min[3] = 0; - axis_cen[3] = temp_values[3]/2; - axis_max[3] = temp_values[3]; - joy_delay(); - } - - if (Joy_is_Sidewinder || Config_control_type != CONTROL_THRUSTMASTER_FCS) { - // masks = joy_get_present_mask(); - - if ( nsticks == 2 ) { - if ( kconfig_is_axes_used(2) || kconfig_is_axes_used(3) ) { - if(Joy_is_Sidewinder) - { - sprintf( title, "%s\nTWIST-LEFT", TXT_JOYSTICK); - sprintf( text, "Twist Joystick to \nthe left side"); - } - else - { - sprintf( title, "%s #2\n%s", TXT_JOYSTICK, TXT_UPPER_LEFT); - sprintf( text, "%s #2 %s", TXT_MOVE_JOYSTICK, TXT_TO_UL); - } - if (joycal_message( title, text )) { - joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max); - return; - } - joystick_read_raw_axis( JOY_ALL_AXIS, temp_values ); - axis_min[2] = temp_values[2]; - axis_min[3] = temp_values[3]; - joy_delay(); - - if(Joy_is_Sidewinder) - { - sprintf( title, "%s\nTWIST-RIGHT", TXT_JOYSTICK); - sprintf( text, "Twist Joystick to \nthe right side"); - } - else - { - sprintf( title, "%s #2\n%s", TXT_JOYSTICK, TXT_LOWER_RIGHT); - sprintf( text, "%s #2 %s", TXT_MOVE_JOYSTICK, TXT_TO_LR); - } - if (joycal_message( title, text )) { - joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max); - return; - } - joystick_read_raw_axis( JOY_ALL_AXIS, temp_values ); - axis_max[2] = temp_values[2]; - axis_max[3] = temp_values[3]; - joy_delay(); - - - if(Joy_is_Sidewinder) - { - sprintf( title, "%s\nCENTER", TXT_JOYSTICK); - sprintf( text, "%s %s",TXT_MOVE_JOYSTICK, TXT_TO_C); - } - else - { - sprintf( title, "%s #2\n%s", TXT_JOYSTICK, TXT_CENTER); - sprintf( text, "%s #2 %s", TXT_MOVE_JOYSTICK, TXT_TO_C); - } - - if (joycal_message( title, text )) { - joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max); - return; - } - joystick_read_raw_axis( JOY_ALL_AXIS, temp_values ); - axis_cen[2] = temp_values[2]; - axis_cen[3] = temp_values[3]; - joy_delay(); - } - } else if ( (!(masks & JOY_2_X_AXIS)) && (masks & JOY_2_Y_AXIS) ) { - if ( kconfig_is_axes_used(3) ) { - // A throttle axis!!!!! - sprintf( title, "%s\n%s", TXT_THROTTLE, TXT_FORWARD); - if (joycal_message( title, TXT_MOVE_THROTTLE_F)) { - joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max); - return; - } - joystick_read_raw_axis( JOY_ALL_AXIS, temp_values ); - axis_min[3] = temp_values[3]; - joy_delay(); - - sprintf( title, "%s\n%s", TXT_THROTTLE, TXT_REVERSE); - if (joycal_message( title, TXT_MOVE_THROTTLE_R)) { - joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max); - return; - } - joystick_read_raw_axis( JOY_ALL_AXIS, temp_values ); - axis_max[3] = temp_values[3]; - joy_delay(); - - sprintf( title, "%s\n%s", TXT_THROTTLE, TXT_CENTER); - if (joycal_message( title, TXT_MOVE_THROTTLE_C)) { - joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max); - return; - } - joystick_read_raw_axis( JOY_ALL_AXIS, temp_values ); - axis_cen[3] = temp_values[3]; - joy_delay(); - } - } - } - joy_set_cal_vals(axis_min, axis_cen, axis_max); - - -//added 9/1/98 by Victor Rachels to make sidewinder calibratable -/* if(Joy_is_Sidewinder) - Config_control_type=tempstick; */ -//end this section addition - Victor Rachels - - - WriteConfigFile(); -} - - -//char *control_text[CONTROL_MAX_TYPES] = { "Keyboard only", "Joystick", "Flightstick Pro", "Thrustmaster FCS", "Gravis Gamepad", "Mouse", "Cyberman" }; - -void joydef_menuset_1(int nitems, newmenu_item * items, int *last_key, int citem ) -{ - int i; - int oc_type = Config_control_type; - - nitems = nitems; - last_key = last_key; - citem = citem; - - for (i=0; i-1); - - switch (Config_control_type) { - case CONTROL_JOYSTICK: - case CONTROL_FLIGHTSTICK_PRO: - case CONTROL_THRUSTMASTER_FCS: - case CONTROL_GRAVIS_GAMEPAD: - if ( joydefs_calibrate_flag ) - joydefs_calibrate(); - break; - } - -} - diff --git a/arch/dos/key.c b/arch/dos/key.c deleted file mode 100644 index 36882000..00000000 --- a/arch/dos/key.c +++ /dev/null @@ -1,709 +0,0 @@ -/* -THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -*/ -/* - * $Source: /cvs/cvsroot/d2x/arch/dos/key.c,v $ - * $Revision: 1.1.1.2 $ - * $Author: bradleyb $ - * $Date: 2001-01-19 03:33:52 $ - * - * Functions for keyboard handler. - * - * $Log: not supported by cvs2svn $ - * Revision 1.1.1.1 1999/06/14 21:58:32 donut - * Import of d1x 1.37 source. - * - * Revision 1.35 1995/01/25 20:13:30 john - * Took out not passing keys to debugger if w10. - * - * Revision 1.34 1995/01/14 19:19:31 john - * Made so when you press Shift+Baskspace, it release keys autmatically. - * - * Revision 1.33 1994/12/13 09:21:48 john - * Took out keyd_editor_mode, and KEY_DEBUGGED stuff for NDEBUG versions. - * - * Revision 1.32 1994/11/12 13:52:01 john - * Fixed bug with code that cleared bios buffer. - * - * Revision 1.31 1994/10/24 15:16:16 john - * Added code to detect KEY_PAUSE. - * - * Revision 1.30 1994/10/24 13:57:53 john - * Hacked in support for pause key onto code 0x61. - * - * Revision 1.29 1994/10/21 15:18:13 john - * *** empty log message *** - * - * Revision 1.28 1994/10/21 15:17:24 john - * Made LSHIFT+BACKSPACE do what PrtScr used to. - * - * Revision 1.27 1994/09/22 16:09:18 john - * Fixed some virtual memory lockdown problems with timer and - * joystick. - * - * Revision 1.26 1994/09/15 21:32:47 john - * Added bounds checking for down_count scancode - * parameter. - * - * Revision 1.25 1994/08/31 12:22:20 john - * Added KEY_DEBUGGED - * - * Revision 1.24 1994/08/24 18:53:48 john - * Made Cyberman read like normal mouse; added dpmi module; moved - * mouse from assembly to c. Made mouse buttons return time_down. - * - * Revision 1.23 1994/08/18 15:17:51 john - * *** empty log message *** - * - * Revision 1.22 1994/08/18 15:16:38 john - * fixed some bugs with clear_key_times and then - * removed it because i fixed key_flush to do the - * same. - * - * Revision 1.21 1994/08/17 19:01:25 john - * Attempted to fix a bug with a key being held down - * key_flush called, then the key released having too - * long of a time. - * - * Revision 1.20 1994/08/08 10:43:48 john - * Recorded when a key was pressed for key_inkey_time. - * - * Revision 1.19 1994/06/22 15:00:03 john - * Made keyboard close automatically on exit. - * - * Revision 1.18 1994/06/21 09:16:29 john - * *** empty log message *** - * - * Revision 1.17 1994/06/21 09:08:23 john - * *** empty log message *** - * - * Revision 1.16 1994/06/21 09:05:01 john - * *** empty log message *** - * - * Revision 1.15 1994/06/21 09:04:24 john - * Made PrtScreen do an int5 - * - * Revision 1.14 1994/06/17 17:17:06 john - * Added keyd_time_last_key_was_pressed or something like that. - * - * Revision 1.13 1994/05/14 13:55:16 matt - * Added #define to control key passing to bios - * - * Revision 1.12 1994/05/05 18:09:39 john - * Took out BIOS to prevent stuck keys. - * - * Revision 1.11 1994/05/03 17:39:12 john - * *** empty log message *** - * - * Revision 1.10 1994/04/29 12:14:20 john - * Locked all memory used during interrupts so that program - * won't hang when using virtual memory. - * - * Revision 1.9 1994/04/28 23:49:41 john - * Made key_flush flush more keys and also did something else but i forget what. - * - * Revision 1.8 1994/04/22 12:52:12 john - * *** empty log message *** - * - * Revision 1.7 1994/04/01 10:44:59 mike - * Change key_getch() to call getch() if our interrupt hasn't been installed. - * - * Revision 1.6 1994/03/09 10:45:48 john - * Neatend code a bit. - * - * Revision 1.5 1994/02/17 17:24:16 john - * Neatened up a bit. - * - * Revision 1.4 1994/02/17 16:30:29 john - * Put in code to pass keys when in debugger. - * - * Revision 1.3 1994/02/17 15:57:59 john - * Made handler not chain to BIOS handler. - * - * Revision 1.2 1994/02/17 15:56:06 john - * Initial version. - * - * Revision 1.1 1994/02/17 15:54:07 john - * Initial revision - * - * - */ - -//#define PASS_KEYS_TO_BIOS 1 //if set, bios gets keys - -#include -#include -#include -#include - -//#define WATCOM_10 -#ifdef __DJGPP__ -#include -#define _far -#define __far -#define __interrupt -#define near -_go32_dpmi_seginfo kbd_hand_info; -#endif -#include "error.h" -#include "key.h" -#include "timer.h" -#include "u_dpmi.h" - -#define KEY_BUFFER_SIZE 16 - - -//-------- Variable accessed by outside functions --------- -unsigned char keyd_buffer_type; // 0=No buffer, 1=buffer ASCII, 2=buffer scans -unsigned char keyd_repeat; -unsigned char keyd_editor_mode; -volatile unsigned char keyd_last_pressed; -volatile unsigned char keyd_last_released; -volatile unsigned char keyd_pressed[256]; -volatile int keyd_time_when_last_pressed; - -typedef struct keyboard { - unsigned short keybuffer[KEY_BUFFER_SIZE]; - fix time_pressed[KEY_BUFFER_SIZE]; - fix TimeKeyWentDown[256]; - fix TimeKeyHeldDown[256]; - unsigned int NumDowns[256]; - unsigned int NumUps[256]; - unsigned int keyhead, keytail; - unsigned char E0Flag; - unsigned char E1Flag; - int in_key_handler; -#ifdef __DJGPP__ - _go32_dpmi_seginfo prev_int_9; -#else - void (__interrupt __far *prev_int_9)(); -#endif -} keyboard; - -static volatile keyboard key_data; - -static unsigned char Installed=0; - -unsigned char ascii_table[128] = -{ 255, 255, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=',255,255, - 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', 255, 255, - 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', 39, '`', - 255, '\\', 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', 255,'*', - 255, ' ', 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,255,255, - 255, 255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255 }; - -unsigned char shifted_ascii_table[128] = -{ 255, 255, '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+',255,255, - 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', 255, 255, - 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"', '~', - 255, '|', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?', 255,255, - 255, ' ', 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,255,255, - 255, 255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255 }; -/* -char * key_text[256] = { -"","ESC","1","2","3","4","5","6","7","8","9","0","-", -"=","BSPC","TAB","Q","W","E","R","T","Y","U","I","O", -"P","[","]","ƒ","LCTRL","A","S","D","F", -"G","H","J","K","L",";","'","`", -"LSHFT","\\","Z","X","C","V","B","N","M",",", -".","/","RSHFT","PAD*","LALT","SPC", -"CPSLK","F1","F2","F3","F4","F5","F6","F7","F8","F9", -"F10","NMLCK","SCLK","PAD7","PAD8","PAD9","PAD-", -"PAD4","PAD5","PAD6","PAD+","PAD1","PAD2","PAD3","PAD0", -"PAD.","","","","F11","F12","","","","","","","","","", -"","","","","","","","","","","","","","","","","","","","", -"","","","","","","","","","","","","","","","","","","","", -"","","","","","","","","","","","","","","","","","", -"PADƒ","RCTRL","","","","","","","","","","","","","", -"","","","","","","","","","","PAD/","","","RALT","", -"","","","","","","","","","","","","","HOME","‚","PGUP", -"","","","","","END","€","PGDN","INS", -"DEL","","","","","","","","","","","","","","","","","", -"","","","","","","","","","","","","","","","","","","","", -"","","","","","","" }; -*/ -unsigned char key_to_ascii(int keycode ) -{ - int shifted; - - shifted = keycode & KEY_SHIFTED; - keycode &= 0xFF; - - if ( keycode>=127 ) - return 255; - - if (shifted) - return shifted_ascii_table[keycode]; - else - return ascii_table[keycode]; -} - -void key_clear_bios_buffer_all() -{ -#ifdef __WATCOMC__ - // Clear keyboard buffer... - *(ushort *)0x41a=*(ushort *)0x41c; - // Clear the status bits... - *(ubyte *)0x417 = 0; - *(ubyte *)0x418 = 0; -#else - _farpokew(_dos_ds,0x41a, _farpeekw(_dos_ds, 0x41c)); - _farpokeb(_dos_ds,0x417, 0); - _farpokeb(_dos_ds,0x418, 0); -#endif -} - -void key_clear_bios_buffer() -{ -#ifdef __WATCOMC__ - // Clear keyboard buffer... - *(ushort *)0x41a=*(ushort *)0x41c; -#else - _farpokew(_dos_ds,0x41a, _farpeekw(_dos_ds, 0x41c)); -#endif -} - -void key_flush() -{ - int i; - fix CurTime; - - _disable(); - - // Clear the BIOS buffer - key_clear_bios_buffer(); - - key_data.keyhead = key_data.keytail = 0; - - //Clear the keyboard buffer - for (i=0; i= KEY_BUFFER_SIZE ) n=0; - return n; -} - -// Returns 1 if character waiting... 0 otherwise -int key_checkch() -{ - int is_one_waiting = 0; - - _disable(); - - key_clear_bios_buffer(); - - if (key_data.keytail!=key_data.keyhead) - is_one_waiting = 1; - _enable(); - return is_one_waiting; -} - -int key_inkey() -{ - int key = 0; - - _disable(); - - key_clear_bios_buffer(); - - if (key_data.keytail!=key_data.keyhead) { - key = key_data.keybuffer[key_data.keyhead]; - key_data.keyhead = add_one(key_data.keyhead); - } - _enable(); - return key; -} - -int key_inkey_time(fix * time) -{ - int key = 0; - - _disable(); - - key_clear_bios_buffer(); - - if (key_data.keytail!=key_data.keyhead) { - key = key_data.keybuffer[key_data.keyhead]; - *time = key_data.time_pressed[key_data.keyhead]; - key_data.keyhead = add_one(key_data.keyhead); - } - _enable(); - return key; -} - - - -int key_peekkey() -{ - int key = 0; - - _disable(); - - key_clear_bios_buffer(); - - if (key_data.keytail!=key_data.keyhead) { - key = key_data.keybuffer[key_data.keyhead]; - } - _enable(); - return key; -} - -// If not installed, uses BIOS and returns getch(); -// Else returns pending key (or waits for one if none waiting). -int key_getch() -{ - int dummy=0; - - if (!Installed) - return getch(); - - while (!key_checkch()) - dummy++; - return key_inkey(); -} - -unsigned int key_get_shift_status() -{ - unsigned int shift_status = 0; - - _disable(); - - key_clear_bios_buffer(); - - if ( keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT] ) - shift_status |= KEY_SHIFTED; - - if ( keyd_pressed[KEY_LALT] || keyd_pressed[KEY_RALT] ) - shift_status |= KEY_ALTED; - - if ( keyd_pressed[KEY_LCTRL] || keyd_pressed[KEY_RCTRL] ) - shift_status |= KEY_CTRLED; - -#ifndef NDEBUG - if (keyd_pressed[KEY_DELETE]) - shift_status |=KEY_DEBUGGED; -#endif - - _enable(); - - return shift_status; -} - -// Returns the number of seconds this key has been down since last call. -fix key_down_time(int scancode) { - fix time_down, time; - - if ((scancode<0)|| (scancode>255)) return 0; - -#ifndef NDEBUG - if (keyd_editor_mode && key_get_shift_status() ) - return 0; -#endif - - _disable(); - - if ( !keyd_pressed[scancode] ) { - time_down = key_data.TimeKeyHeldDown[scancode]; - key_data.TimeKeyHeldDown[scancode] = 0; - } else { - time = timer_get_fixed_secondsX(); - time_down = time - key_data.TimeKeyWentDown[scancode]; - key_data.TimeKeyWentDown[scancode] = time; - } - _enable(); - - return time_down; -} - -// Returns number of times key has went from up to down since last call. -unsigned int key_down_count(int scancode) { - int n; - - if ((scancode<0)|| (scancode>255)) return 0; - - _disable(); - n = key_data.NumDowns[scancode]; - key_data.NumDowns[scancode] = 0; - _enable(); - - return n; -} - - -// Returns number of times key has went from down to up since last call. -unsigned int key_up_count(int scancode) { - int n; - - if ((scancode<0)|| (scancode>255)) return 0; - - _disable(); - n = key_data.NumUps[scancode]; - key_data.NumUps[scancode] = 0; - _enable(); - - return n; -} - -// Use intrinsic forms so that we stay in the locked interrup code. - -#ifdef __WATCOMC__ -void Int5(); -#pragma aux Int5 = "int 5"; -#else -#ifdef __GNUC__ -#define Int5() asm volatile("int $5") -#endif -#endif - -#pragma off (check_stack) -void __interrupt __far key_handler() -{ - unsigned char scancode, breakbit, temp; - unsigned short keycode; - -#ifndef WATCOM_10 -#ifndef NDEBUG -#ifdef __WATCOMC__ /* must have _chain_intr */ - ubyte * MONO = (ubyte *)(0x0b0000+24*80*2); - if ( ((MONO[0]=='D') && (MONO[2]=='B') && (MONO[4]=='G') && (MONO[6]=='>')) || - ((MONO[14]=='<') && (MONO[16]=='i') && (MONO[18]=='>') && (MONO[20]==' ') && (MONO[22]=='-')) || - ((MONO[0]==200 ) && (MONO[2]==27) && (MONO[4]==17) ) - ) - _chain_intr( key_data.prev_int_9 ); -#endif -#endif -#endif - - // Read in scancode - scancode = inp( 0x60 ); - - switch( scancode ) { - case 0xE0: - key_data.E0Flag = 0x80; - break; - default: - // Parse scancode and break bit - if (key_data.E1Flag > 0 ) { // Special code for Pause, which is E1 1D 45 E1 9D C5 - key_data.E1Flag--; - if ( scancode == 0x1D ) { - scancode = KEY_PAUSE; - breakbit = 0; - } else if ( scancode == 0x9d ) { - scancode = KEY_PAUSE; - breakbit = 1; - } else { - break; // skip this keycode - } - } else if ( scancode==0xE1 ) { - key_data.E1Flag = 2; - break; - } else { - breakbit = scancode & 0x80; // Get make/break bit - scancode &= 0x7f; // Strip make/break bit off of scancode - scancode |= key_data.E0Flag; // Add in extended key code - } - key_data.E0Flag = 0; // Clear extended key code - - if (breakbit) { - // Key going up - keyd_last_released = scancode; - keyd_pressed[scancode] = 0; - key_data.NumUps[scancode]++; - temp = 0; - temp |= keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]; - temp |= keyd_pressed[KEY_LALT] || keyd_pressed[KEY_RALT]; - temp |= keyd_pressed[KEY_LCTRL] || keyd_pressed[KEY_RCTRL]; -#ifndef NDEBUG - temp |= keyd_pressed[KEY_DELETE]; - if ( !(keyd_editor_mode && temp) ) -#endif // NOTICE LINK TO ABOVE IF!!!! - key_data.TimeKeyHeldDown[scancode] += timer_get_fixed_secondsX() - key_data.TimeKeyWentDown[scancode]; - } else { - // Key going down - keyd_last_pressed = scancode; - keyd_time_when_last_pressed = timer_get_fixed_secondsX(); - if (!keyd_pressed[scancode]) { - // First time down - key_data.TimeKeyWentDown[scancode] = timer_get_fixed_secondsX(); - keyd_pressed[scancode] = 1; - key_data.NumDowns[scancode]++; -#ifndef NDEBUG - if ( (keyd_pressed[KEY_LSHIFT]) && (scancode == KEY_BACKSP) ) { - keyd_pressed[KEY_LSHIFT] = 0; - Int5(); - } -#endif - } else if (!keyd_repeat) { - // Don't buffer repeating key if repeat mode is off - scancode = 0xAA; - } - - if ( scancode!=0xAA ) { - keycode = scancode; - - if ( keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT] ) - keycode |= KEY_SHIFTED; - - if ( keyd_pressed[KEY_LALT] || keyd_pressed[KEY_RALT] ) - keycode |= KEY_ALTED; - - if ( keyd_pressed[KEY_LCTRL] || keyd_pressed[KEY_RCTRL] ) - keycode |= KEY_CTRLED; - -#ifndef NDEBUG - if ( keyd_pressed[KEY_DELETE] ) - keycode |= KEY_DEBUGGED; -#endif - - temp = key_data.keytail+1; - if ( temp >= KEY_BUFFER_SIZE ) temp=0; - - if (temp!=key_data.keyhead) { - key_data.keybuffer[key_data.keytail] = keycode; - key_data.time_pressed[key_data.keytail] = keyd_time_when_last_pressed; - key_data.keytail = temp; - } - } - } - } - -#ifndef NDEBUG -#ifdef PASS_KEYS_TO_BIOS - _chain_intr( key_data.prev_int_9 ); -#endif -#endif - - temp = inp(0x61); // Get current port 61h state - temp |= 0x80; // Turn on bit 7 to signal clear keybrd - outp( 0x61, temp ); // Send to port - temp &= 0x7f; // Turn off bit 7 to signal break - outp( 0x61, temp ); // Send to port - outp( 0x20, 0x20 ); // Reset interrupt controller -} - -#pragma on (check_stack) - -void key_handler_end() { // Dummy function to help calculate size of keyboard handler function -} - -void key_init() -{ - // Initialize queue - - keyd_time_when_last_pressed = timer_get_fixed_seconds(); - keyd_buffer_type = 1; - keyd_repeat = 1; - key_data.in_key_handler = 0; - key_data.E0Flag = 0; - key_data.E1Flag = 0; - - // Clear the keyboard array - key_flush(); - - if (Installed) return; - Installed = 1; - - //--------------- lock everything for the virtal memory ---------------------------------- - if (!dpmi_lock_region ((void near *)key_handler, (char *)key_handler_end - (char near *)key_handler)) { - printf( "Error locking keyboard handler!\n" ); - exit(1); - } - if (!dpmi_lock_region ((void *)&key_data, sizeof(keyboard))) { - printf( "Error locking keyboard handler's data1!\n" ); - exit(1); - } - if (!dpmi_lock_region (&keyd_buffer_type, sizeof(char))) { - printf( "Error locking keyboard handler's data2!\n" ); - exit(1); - } - if (!dpmi_lock_region (&keyd_repeat, sizeof(char))) { - printf( "Error locking keyboard handler's data3!\n" ); - exit(1); - } - if (!dpmi_lock_region (&keyd_editor_mode, sizeof(char))) { - printf( "Error locking keyboard handler's data4!\n" ); - exit(1); - } - if (!dpmi_lock_region ((void *)&keyd_last_pressed, sizeof(char))) { - printf( "Error locking keyboard handler's data5!\n" ); - exit(1); - } - if (!dpmi_lock_region ((void *)&keyd_last_released, sizeof(char))) { - printf( "Error locking keyboard handler's data6!\n" ); - exit(1); - } - if (!dpmi_lock_region ((void *)&keyd_pressed, sizeof(char)*256)) { - printf( "Error locking keyboard handler's data7!\n" ); - exit(1); - } - if (!dpmi_lock_region ((void *)&keyd_time_when_last_pressed, sizeof(int))) { - printf( "Error locking keyboard handler's data8!\n" ); - exit(1); - } - -#ifndef __DJGPP__ - key_data.prev_int_9 = (void *)_dos_getvect( 9 ); - _dos_setvect( 9, key_handler ); -#else - _go32_dpmi_get_protected_mode_interrupt_vector(9, - (_go32_dpmi_seginfo *)&key_data.prev_int_9); - kbd_hand_info.pm_offset = (int)key_handler; - kbd_hand_info.pm_selector = _my_cs(); - _go32_dpmi_allocate_iret_wrapper(&kbd_hand_info); - _go32_dpmi_set_protected_mode_interrupt_vector(9, &kbd_hand_info); -#endif - - atexit( key_close ); -} - -void key_close() -{ - if (!Installed) return; - Installed = 0; - -#ifndef __DJGPP__ - _dos_setvect( 9, key_data.prev_int_9 ); -#else - _go32_dpmi_set_protected_mode_interrupt_vector(9, - (_go32_dpmi_seginfo *)&key_data.prev_int_9); -#endif - - _disable(); - key_clear_bios_buffer_all(); - _enable(); - -} diff --git a/arch/dos/mm_snd/Makefile.am b/arch/dos/mm_snd/Makefile.am new file mode 100644 index 00000000..c88a2ef0 --- /dev/null +++ b/arch/dos/mm_snd/Makefile.am @@ -0,0 +1,5 @@ +SUBDIRS = include + +EXTRA_DIST = \ +readme.txt \ +drv_sb.c mdma.c mirq.c diff --git a/arch/dos/mm_snd/include/Makefile.am b/arch/dos/mm_snd/include/Makefile.am new file mode 100644 index 00000000..c4695e25 --- /dev/null +++ b/arch/dos/mm_snd/include/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ +mdma.h mikmod.h mirq.h mm_drv.h mmio.h mtypes.h diff --git a/arch/dos/modex.asm b/arch/dos/modex.asm deleted file mode 100644 index 1f149eb7..00000000 --- a/arch/dos/modex.asm +++ /dev/null @@ -1,829 +0,0 @@ -;THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -;SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -;END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -;ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -;IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -;SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -;FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -;CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -;AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -; -; $Source: /cvs/cvsroot/d2x/arch/dos/modex.asm,v $ -; $Revision: 1.1.1.1 $ -; $Author: bradleyb $ -; $Date: 2001-01-19 03:30:15 $ -; -; Routines to access ModeX VGA memory -; -; $Log: not supported by cvs2svn $ -; Revision 1.1.1.1 1999/06/14 21:57:56 donut -; Import of d1x 1.37 source. -; -; Revision 1.19 1995/03/01 15:37:46 john -; Better ModeX support. -; -; Revision 1.18 1994/11/24 13:24:20 john -; Made sure that some rep movs had the cld set first. -; Took some unused functions out. -; -; Revision 1.17 1994/09/22 18:15:02 john -; Made flip page wait for retrace. -; -; Revision 1.16 1994/09/22 16:08:27 john -; Fixed some palette stuff. -; -; Revision 1.15 1994/07/13 12:03:05 john -; Added assembly modex line-drawer. -; -; Revision 1.14 1994/05/06 12:50:34 john -; Added supertransparency; neatend things up; took out warnings. -; -; Revision 1.13 1994/05/03 19:39:04 john -; *** empty log message *** -; -; Revision 1.12 1994/02/18 15:32:32 john -; *** empty log message *** -; -; Revision 1.11 1993/12/21 11:40:36 john -; *** empty log message *** -; -; Revision 1.10 1993/12/09 15:02:26 john -; Changed palette stuff majorly -; -; Revision 1.9 1993/12/03 12:11:32 john -; fixed cx/ecx loop bugs. -; -; Revision 1.8 1993/11/16 11:28:18 john -; *** empty log message *** -; -; Revision 1.7 1993/10/15 16:23:23 john -; y -; -; Revision 1.6 1993/09/28 19:07:19 john -; stripped the waitforretrace out of fade to speed things up. -; -; Revision 1.5 1993/09/26 18:58:58 john -; fade stuff -; -; Revision 1.4 1993/09/21 14:01:15 john -; turned off video before mode set to reduce flicker. -; -; Revision 1.3 1993/09/08 11:38:36 john -; changed rcs stuff at beginning. -; -; -; - - -[BITS 32] - -section .data -%include "vgaregs.inc" -%include "tweak.inc" - -extern _gr_var_bwidth -extern _gr_video_memory - -global _modex_line_vertincr -global _modex_line_incr1 -global _modex_line_incr2 -global _modex_line_x1 -global _modex_line_x2 -global _modex_line_y1 -global _modex_line_y2 -global _modex_line_Color - -_modex_line_vertincr dd 0 -_modex_line_incr1 dd 0 -_modex_line_incr2 dd 0 -_modex_line_x1 dd 0 -_modex_line_y1 dd 0 -_modex_line_x2 dd 0 -_modex_line_y2 dd 0 -_modex_line_Color db 0 - - -_modex_line_routine dd 0 -SavedColor db 0 - -%define LEFT_MASK1 1000b -%define LEFT_MASK2 1100b -%define LEFT_MASK3 1110b -%define RIGHT_MASK1 0001b -%define RIGHT_MASK2 0011b -%define RIGHT_MASK3 0111b -%define ALL_MASK 1111b - -tmppal times 768 db 0 -fb_pal dd 0 -fb_add dw 0 -fb_count dd 0 - -MaskTable1 db ALL_MASK & RIGHT_MASK1 - db ALL_MASK & RIGHT_MASK2 - db ALL_MASK & RIGHT_MASK3 - db ALL_MASK - db LEFT_MASK3 & RIGHT_MASK1 - db LEFT_MASK3 & RIGHT_MASK2 - db LEFT_MASK3 & RIGHT_MASK3 - db LEFT_MASK3 - db LEFT_MASK2 & RIGHT_MASK1 - db LEFT_MASK2 & RIGHT_MASK2 - db LEFT_MASK2 & RIGHT_MASK3 - db LEFT_MASK2 - db LEFT_MASK1 & RIGHT_MASK1 - db LEFT_MASK1 & RIGHT_MASK2 - db LEFT_MASK1 & RIGHT_MASK3 - db LEFT_MASK1 - -MaskTable2 db ALL_MASK,RIGHT_MASK1 - db ALL_MASK,RIGHT_MASK2 - db ALL_MASK,RIGHT_MASK3 - db ALL_MASK,ALL_MASK - db LEFT_MASK3,RIGHT_MASK1 - db LEFT_MASK3,RIGHT_MASK2 - db LEFT_MASK3,RIGHT_MASK3 - db LEFT_MASK3,ALL_MASK - db LEFT_MASK2,RIGHT_MASK1 - db LEFT_MASK2,RIGHT_MASK2 - db LEFT_MASK2,RIGHT_MASK3 - db LEFT_MASK2,ALL_MASK - db LEFT_MASK1,RIGHT_MASK1 - db LEFT_MASK1,RIGHT_MASK2 - db LEFT_MASK1,RIGHT_MASK3 - db LEFT_MASK1,ALL_MASK - -DrawTable dd DrawMR - dd DrawMR - dd DrawMR - dd DrawM - dd DrawLMR - dd DrawLMR - dd DrawLMR - dd DrawLM - dd DrawLMR - dd DrawLMR - dd DrawLMR - dd DrawLM - dd DrawLMR - dd DrawLMR - dd DrawLMR - dd DrawLM - -section .text - -global _gr_sync_display - -_gr_sync_display: - mov dx, VERT_RESCAN -VS2A: in al, dx - and al, 08h - jnz VS2A ; Loop until not in vertical retrace -VS2B: in al, dx - and al, 08h - jz VS2B ; Loop until in vertical retrace - ret - - -; gr_modex_uscanline(int x1,int x2,int y,int color); -global _gr_modex_uscanline - -_gr_modex_uscanline: - push ebx - mov eax,[esp+8];x1 - mov edx,[esp+12];x2 - mov ebx,[esp+16];y - mov ecx,[esp+20];color - push edi - - ; EAX = X1 (X1 and X2 don't need to be sorted) - ; EDX = X2 - ; EBX = Y - ; ECX = Color - - mov [SavedColor], cl - - ;mov ebx, _RowOffset[ebx*4] - mov edi, [_gr_var_bwidth] - imul edi, ebx - add edi, [_gr_video_memory] - cmp eax, edx - jle @@f1 - xchg eax, edx -@@f1: mov bl, al - shl bl, 2 - mov bh, dl - and bh, 011b - or bl, bh - and ebx, 0fh - ; BX = LeftRight switch command. (4bit) - shr eax, 2 - shr edx, 2 - add edi, eax - ; EDI = Offset into video memory - mov ecx, edx - sub ecx, eax - ; ECX = X2/4 - X1/4 - 1 - jnz LargerThan4 - -;======================= ONE GROUP OF 4 OR LESS TO DRAW ==================== - - mov dx, SC_INDEX - mov al, SC_MAP_MASK - out dx, al - inc dx - mov al, [MaskTable1+ebx] - out dx, al - mov al, [SavedColor] - mov [edi], al ; Write the one pixel - pop edi - pop ebx - ret - -LargerThan4: - dec ecx - jnz LargerThan8 - -;===================== TWO GROUPS OF 4 OR LESS TO DRAW ==================== - - mov cx, word [MaskTable2+ebx*2] - mov bl, [SavedColor] - mov dx, SC_INDEX - mov al, SC_MAP_MASK - out dx, al - inc dx - mov al, cl - out dx, al - mov [edi], bl ; Write the left pixel - mov al, ch - out dx, al - mov [edi+1], bl ; Write the right pixel - pop edi - pop ebx - ret - -;========================= MANY GROUPS OF 4 TO DRAW ====================== -LargerThan8: - mov dx, SC_INDEX - mov al, SC_MAP_MASK - out dx, al - inc dx - ; DX = SC_INDEX - mov al, [SavedColor] - mov ah, al - ; AL,AH = color of pixel - jmp dword [DrawTable+ebx*4] - - -DrawM: ;AH=COLOR, EDI=DEST, CX=X2/4-X1/4-1, BX=Table Index - mov al, ALL_MASK - out dx, al - mov al, ah - cld - add ecx, 2 - shr ecx, 1 - rep stosw ; Write the middle pixels - jnc @@f2 - stosb ; Write the middle odd pixel -@@f2: pop edi - pop ebx - ret - -DrawLM: - ;AH=COLOR, EDI=DEST, CX=X2/4-X1/4-1, BX=Table Index - mov al, byte [MaskTable2+ebx*2] - out dx, al - mov [edi], ah ; Write leftmost pixels - inc edi - mov al, ALL_MASK - out dx, al - mov al, ah - cld - inc ecx - shr ecx, 1 - rep stosw ; Write the middle pixels - jnc @@f3 - stosb ; Write the middle odd pixel -@@f3: pop edi - pop ebx - ret - - -DrawLMR: ;AH=COLOR, EDI=DEST, CX=X2/4-X1/4-1, BX=Table Index - mov bx, word [MaskTable2+ebx*2] - mov al, bl - out dx, al - mov [edi], ah ; Write leftmost pixels - inc edi - mov al, ALL_MASK - out dx, al - mov al, ah - cld - shr ecx, 1 - rep stosw ; Write the middle pixels - jnc @@f4 - stosb ; Write the middle odd pixel -@@f4: mov al, bh - out dx, al - mov [edi], ah ; Write the rightmost pixels - pop edi - pop ebx - ret - -DrawMR: ;AH=COLOR, EDI=DEST, CX=X2/4-X1/4-1, BX=Table Index - mov bx, word [MaskTable2+ebx*2] - mov al, ALL_MASK - out dx, al - mov al, ah - cld - inc ecx - shr ecx, 1 - rep stosw ; Write the middle pixels - jnc @@f5 - stosb ; Write the middle odd pixel -@@f5: mov al, bh - out dx, al - mov [edi], ah ; Write the rightmost pixels - pop edi - pop ebx - ret - - -global _gr_modex_setmode - -_gr_modex_setmode: - mov eax,[esp+4] - push ecx - push edx - push esi - push edi - - mov ecx, eax - dec ecx - - cmp ecx, LAST_X_MODE - jbe @@f6 - mov ecx, 0 -@@f6: - - ;call turn_screen_off - - push ecx ; some bios's dont preserve cx - - ;mov ax, 1201h - ;mov bl, 31h ; disable palette loading at mode switch - ;int 10h - mov ax,13h ; let the BIOS set standard 256-color - int 10h ; mode (320x200 linear) - ;mov ax, 1200h - ;mov bl, 31h ; enable palette loading at mode switch - ;int 10h - - pop ecx - - mov dx,SC_INDEX - mov ax,0604h - out dx,ax ; disable chain4 mode - - mov dx,SC_INDEX - mov ax,0100h - out dx,ax ; synchronous reset while setting Misc - ; Output for safety, even though clock - ; unchanged - - mov esi, dword [ModeTable+ecx*4] - lodsb - - or al,al - jz DontSetDot - - mov dx,MISC_OUTPUT - out dx,al ; select the dot clock and Horiz - ; scanning rate - - ;mov dx,SC_INDEX - ;mov al,01h - ;out dx,al - ;inc dx - ;in al, dx - ;or al, 1000b - ;out dx, al - -DontSetDot: - mov dx,SC_INDEX - mov ax,0300h - out dx,ax ; undo reset (restart sequencer) - - mov dx,CRTC_INDEX ; reprogram the CRT Controller - mov al,11h ; VSync End reg contains register write - out dx,al ; protect bit - inc dx ; CRT Controller Data register - in al,dx ; get current VSync End register setting - and al,07fh ; remove write protect on various - out dx,al ; CRTC registers - dec dx ; CRT Controller Index - cld - xor ecx,ecx - lodsb - mov cl,al - -SetCRTParmsLoop: - lodsw ; get the next CRT Index/Data pair - out dx,ax ; set the next CRT Index/Data pair - loop SetCRTParmsLoop - - mov dx,SC_INDEX - mov ax,0f02h - out dx,ax ; enable writes to all four planes - mov edi, [_gr_video_memory] ; point ES:DI to display memory - xor eax,eax ; clear to zero-value pixels - mov ecx,4000h ; # of dwords in display memory - rep stosd ; clear all of display memory - - ; Set pysical screen dimensions - - xor eax, eax - lodsw ; Load scrn pixel width - mov cx, ax - shl eax, 16 - - mov dx,CRTC_INDEX - mov al,CRTC_OFFSET - out dx,al - inc dx - mov ax,cx - shr ax,3 - out dx,al - - ;mov si, 360 - ;@@: - ;mov ax, 04f06h - ;mov bl, 0 - ;mov cx, si - ;int 10h - ;cmp cx, si - ;je @f - ;inc si - ;jmp @B - ;@@: - ;movzx eax, si - - lodsw ; Load Screen Phys. Height - - ;call turn_screen_on - - pop edi - pop esi - pop edx - pop ecx - - ret - -global _gr_modex_setplane - -_gr_modex_setplane: - mov eax,[esp+4] - - mov cl, al - - ; SELECT WRITE PLANE - and cl,011b ;CL = plane - mov ax,0100h + MAP_MASK ;AL = index in SC of Map Mask reg - shl ah,cl ;set only the bit for the required - ; plane to 1 - mov dx,SC_INDEX ;set the Map Mask to enable only the - out dx,ax ; pixel's plane - - ; SELECT READ PLANE - mov ah,cl ;AH = plane - mov al,READ_MAP ;AL = index in GC of the Read Map reg - mov dx,GC_INDEX ;set the Read Map to read the pixel's - out dx,ax ; plane - ret - -global _gr_modex_setstart - -_gr_modex_setstart: - push ebx - mov eax,[esp+8] - mov edx,[esp+12] - mov ebx,[esp+16] - push ebx - - ; EAX = X - ; EDX = Y - ; EBX = Wait for retrace - - mov ecx, [_gr_var_bwidth] - imul ecx, edx - - shr eax, 2 - add eax, ecx - - mov ch, ah - mov bh, al - - mov bl, CC_START_LO - mov cl, CC_START_HI - - cli - mov dx, VERT_RESCAN -WaitDE: in al, dx - test al, 01h - jnz WaitDE - - mov dx, CRTC_INDEX - mov ax, bx - out dx, ax ; Start address low - mov ax, cx - out dx, ax ; Start address high - sti - - pop ebx - cmp ebx, 0 - je NoWaitVS - mov dx, VERT_RESCAN -WaitVS: in al, dx - test al, 08h - jz WaitVS ; Loop until in vertical retrace -NoWaitVS: - - pop ebx - - ret - - - - -%macro ModeXAddr 0 -; given: ebx=x, eax=y, return cl=plane mask, ebx=address, trash eax - mov cl, bl - and cl, 3 - shr ebx, 2 - imul eax, [_gr_var_bwidth] - add ebx, eax - add ebx, [_gr_video_memory] -%endmacro - - -;----------------------------------------------------------------------- -; -; Line drawing function for all MODE X 256 Color resolutions -; Based on code from "PC and PS/2 Video Systems" by Richard Wilton. - -global _gr_modex_line - -_gr_modex_line: - pusha - - mov dx,SC_INDEX ; setup for plane mask access - -; check for vertical line - - mov esi,[_gr_var_bwidth] - mov ecx,[_modex_line_x2] - sub ecx,[_modex_line_x1] - jz near VertLine - -; force x1 < x2 - - jns L01 - - neg ecx - - mov ebx,[_modex_line_x2] - xchg ebx,[_modex_line_x1] - mov [_modex_line_x2],ebx - - mov ebx,[_modex_line_y2] - xchg ebx,[_modex_line_y1] - mov [_modex_line_y2],ebx - -; calc dy = abs(y2 - y1) - -L01: - mov ebx,[_modex_line_y2] - sub ebx,[_modex_line_y1] - jnz short skip - jmp HorizLine -skip: jns L03 - - neg ebx - neg esi - -; select appropriate routine for slope of line - -L03: - mov [_modex_line_vertincr],esi - mov dword [_modex_line_routine],LoSlopeLine - cmp ebx,ecx - jle L04 - mov dword [_modex_line_routine],HiSlopeLine - xchg ebx,ecx - -; calc initial decision variable and increments - -L04: - shl ebx,1 - mov [_modex_line_incr1],ebx - sub ebx,ecx - mov esi,ebx - sub ebx,ecx - mov [_modex_line_incr2],ebx - -; calc first pixel address - - push ecx - mov eax,[_modex_line_y1] - mov ebx,[_modex_line_x1] - ModeXAddr - mov edi,ebx - mov al,1 - shl al,cl - mov ah,al ; duplicate nybble - shl al,4 - add ah,al - mov bl,ah - pop ecx - inc ecx - jmp near dword [_modex_line_routine] - -; routine for verticle lines - -VertLine: - mov eax,[_modex_line_y1] - mov ebx,[_modex_line_y2] - mov ecx,ebx - sub ecx,eax - jge L31 - neg ecx - mov eax,ebx - -L31: - inc ecx - mov ebx,[_modex_line_x1] - push ecx - ModeXAddr - - mov ah,1 - shl ah,cl - mov al,MAP_MASK - out dx,ax - pop ecx - mov ax, word [_modex_line_Color] - -; draw the line - -L32: - mov [ebx],al - add ebx,esi - loop L32 - jmp Lexit - -; routine for horizontal line - -HorizLine: - - mov eax,[_modex_line_y1] - mov ebx,[_modex_line_x1] - ModeXAddr - - mov edi,ebx ; set dl = first byte mask - mov dl,00fh - shl dl,cl - - mov ecx,[_modex_line_x2] ; set dh = last byte mask - and cl,3 - mov dh,00eh - shl dh,cl - not dh - -; determine byte offset of first and last pixel in line - - mov eax,[_modex_line_x2] - mov ebx,[_modex_line_x1] - - shr eax,2 ; set ax = last byte column - shr ebx,2 ; set bx = first byte column - mov ecx,eax ; cx = ax - bx - sub ecx,ebx - - mov eax,edx ; mov end byte masks to ax - mov dx,SC_INDEX ; setup dx for VGA outs - mov bl,[_modex_line_Color] - -; set pixels in leftmost byte of line - - or ecx,ecx ; is start and end pt in same byte - jnz L42 ; no ! - and ah,al ; combine start and end masks - jmp short L44 - -L42: push eax - mov ah,al - mov al,MAP_MASK - out dx,ax - mov al,bl - stosb - dec ecx - -; draw remainder of the line - -L43: - mov ah,0Fh - mov al,MAP_MASK - out dx,ax - mov al,bl - rep stosb - pop eax - -; set pixels in rightmost byte of line - -L44: - mov al,MAP_MASK - out dx, ax - mov [edi],bl - jmp Lexit - - -; routine for dy >= dx (slope <= 1) - -LoSlopeLine: - mov al,MAP_MASK - mov bh,byte [_modex_line_Color] -L10: - mov ah,bl - -L11: - or ah,bl - rol bl,1 - jc L14 - -; bit mask not shifted out - - or esi,esi - jns L12 - add esi,[_modex_line_incr1] - loop L11 - - out dx,ax - mov [edi],bh - jmp short Lexit - -L12: - add esi,[_modex_line_incr2] - out dx,ax - mov [edi],bh - add edi,[_modex_line_vertincr] - loop L10 - jmp short Lexit - -; bit mask shifted out - -L14: out dx,ax - mov [edi],bh - inc edi - or esi,esi - jns L15 - add esi,[_modex_line_incr1] - loop L10 - jmp short Lexit - -L15: - add esi,[_modex_line_incr2] - add edi,[_modex_line_vertincr] - loop L10 - jmp short Lexit - -; routine for dy > dx (slope > 1) - -HiSlopeLine: - mov ebx,[_modex_line_vertincr] - mov al,MAP_MASK -L21: out dx,ax - push eax - mov al,[_modex_line_Color] - mov [edi],al - pop eax - add edi,ebx - -L22: - or esi,esi - jns L23 - - add esi,[_modex_line_incr1] - loop L21 - jmp short Lexit - -L23: - add esi,[_modex_line_incr2] - rol ah,1 - adc edi,0 -lx21: loop L21 - -; return to caller - -Lexit: - popa - ret diff --git a/arch/dos/mouse.c b/arch/dos/mouse.c deleted file mode 100644 index da635a02..00000000 --- a/arch/dos/mouse.c +++ /dev/null @@ -1,655 +0,0 @@ -/* -THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -*/ -/* - * $Source: /cvs/cvsroot/d2x/arch/dos/mouse.c,v $ - * $Revision: 1.1.1.2 $ - * $Author: bradleyb $ - * $Date: 2001-01-19 03:33:52 $ - * - * Functions to access Mouse and Cyberman... - * - * $Log: not supported by cvs2svn $ - * Revision 1.1.1.1 1999/06/14 21:58:38 donut - * Import of d1x 1.37 source. - * - * Revision 1.11 1995/02/10 18:52:17 john - * Fixed bug with mouse not getting closed. - * - * Revision 1.10 1995/02/02 11:10:33 john - * Changed a bunch of mouse stuff around to maybe get - * around PS/2 mouse hang. - * - * Revision 1.9 1995/01/14 19:19:52 john - * Fixed signed short error cmp with -1 that caused mouse - * to break under Watcom 10.0 - * - * Revision 1.8 1994/12/27 12:38:23 john - * Made mouse use temporary dos buffer instead of - * - * allocating its own. - * - * - * Revision 1.7 1994/12/05 23:54:53 john - * Fixed bug with mouse_get_delta only returning positive numbers.. - * - * Revision 1.6 1994/11/18 23:18:18 john - * Changed some shorts to ints. - * - * Revision 1.5 1994/09/13 12:34:02 john - * Added functions to get down count and state. - * - * Revision 1.4 1994/08/29 20:52:19 john - * Added better cyberman support; also, joystick calibration - * value return funcctiionn, - * - * Revision 1.3 1994/08/24 18:54:32 john - * *** empty log message *** - * - * Revision 1.2 1994/08/24 18:53:46 john - * Made Cyberman read like normal mouse; added dpmi module; moved - * mouse from assembly to c. Made mouse buttons return time_down. - * - * Revision 1.1 1994/08/24 13:56:37 john - * Initial revision - * - * - */ - -#include - -#ifdef __DJGPP__ -#include -#define _BORLAND_DOS_REGS 1 -#define near -_go32_dpmi_registers handler_regs; -#endif - -#include - -#include -#include -//#include -#include -//#include -#include - -#include "error.h" -#include "fix.h" -#include "u_dpmi.h" -#include "mouse.h" -#include "timer.h" - -#define ME_CURSOR_MOVED (1<<0) -#define ME_LB_P (1<<1) -#define ME_LB_R (1<<2) -#define ME_RB_P (1<<3) -#define ME_RB_R (1<<4) -#define ME_MB_P (1<<5) -#define ME_MB_R (1<<6) -#define ME_OB_P (1<<7) -#define ME_OB_R (1<<8) -#define ME_X_C (1<<9) -#define ME_Y_C (1<<10) -#define ME_Z_C (1<<11) -#define ME_P_C (1<<12) -#define ME_B_C (1<<13) -#define ME_H_C (1<<14) -#define ME_O_C (1<<15) - -#define MOUSE_MAX_BUTTONS 11 - -typedef struct event_info { - short x; - short y; - short z; - short pitch; - short bank; - short heading; - ushort button_status; - ushort device_dependant; -} event_info; - -typedef struct mouse_info { - fix ctime; - ubyte cyberman; - int num_buttons; - ubyte pressed[MOUSE_MAX_BUTTONS]; - fix time_went_down[MOUSE_MAX_BUTTONS]; - fix time_held_down[MOUSE_MAX_BUTTONS]; - uint num_downs[MOUSE_MAX_BUTTONS]; - uint num_ups[MOUSE_MAX_BUTTONS]; - event_info *x_info; - ushort button_status; -} mouse_info; - -typedef struct cyberman_info { - ubyte device_type; - ubyte major_version; - ubyte minor_version; - ubyte x_descriptor; - ubyte y_descriptor; - ubyte z_descriptor; - ubyte pitch_descriptor; - ubyte roll_descriptor; - ubyte yaw_descriptor; - ubyte reserved; -} cyberman_info; - -static mouse_info Mouse; - -static int Mouse_installed = 0; - -#ifdef __DJGPP__ -#define m_ax r->d.eax -#define mbx r->d.ebx -#define mcx r->d.ecx -#define mdx r->d.edx -#define msi r->d.esi -#define mdi r->d.edi -void mouse_handler (_go32_dpmi_registers *r) -{ -#else -#pragma off (check_stack) -void _loadds far mouse_handler (int m_ax, int mbx, int mcx, int mdx, int msi, int mdi) -{ -#pragma aux mouse_handler parm [EAX] [EBX] [ECX] [EDX] [ESI] [EDI] -#endif - Mouse.ctime = timer_get_fixed_secondsX(); - - if (m_ax & ME_LB_P) { // left button pressed - if (!Mouse.pressed[MB_LEFT]) { - Mouse.pressed[MB_LEFT] = 1; - Mouse.time_went_down[MB_LEFT] = Mouse.ctime; - } - Mouse.num_downs[MB_LEFT]++; - } else if (m_ax & ME_LB_R ) { // left button released - if (Mouse.pressed[MB_LEFT]) { - Mouse.pressed[MB_LEFT] = 0; - Mouse.time_held_down[MB_LEFT] += Mouse.ctime-Mouse.time_went_down[MB_LEFT]; - } - Mouse.num_ups[MB_LEFT]++; - } - - if (m_ax & ME_RB_P ) { // right button pressed - if (!Mouse.pressed[MB_RIGHT]) { - Mouse.pressed[MB_RIGHT] = 1; - Mouse.time_went_down[MB_RIGHT] = Mouse.ctime; - } - Mouse.num_downs[MB_RIGHT]++; - } else if (m_ax & ME_RB_R ) {// right button released - if (Mouse.pressed[MB_RIGHT]) { - Mouse.pressed[MB_RIGHT] = 0; - Mouse.time_held_down[MB_RIGHT] += Mouse.ctime-Mouse.time_went_down[MB_RIGHT]; - } - Mouse.num_ups[MB_RIGHT]++; - } - - if (m_ax & ME_MB_P ) { // middle button pressed - if (!Mouse.pressed[MB_MIDDLE]) { - Mouse.pressed[MB_MIDDLE] = 1; - Mouse.time_went_down[MB_MIDDLE] = Mouse.ctime; - } - Mouse.num_downs[MB_MIDDLE]++; - } else if (m_ax & ME_MB_R ) { // middle button released - if (Mouse.pressed[MB_MIDDLE]) { - Mouse.pressed[MB_MIDDLE] = 0; - Mouse.time_held_down[MB_MIDDLE] += Mouse.ctime-Mouse.time_went_down[MB_MIDDLE]; - } - Mouse.num_ups[MB_MIDDLE]++; - } - - if (Mouse.cyberman && (m_ax & (ME_Z_C|ME_P_C|ME_B_C|ME_H_C))) { - Mouse.x_info = (event_info *)((msi & 0xFFFF) << 4); - - if (m_ax & ME_Z_C ) { // z axis changed - if (Mouse.pressed[MB_Z_UP]) { - // z up released - Mouse.pressed[MB_Z_UP] = 0; - Mouse.time_held_down[MB_Z_UP] += Mouse.ctime-Mouse.time_went_down[MB_Z_UP]; - Mouse.num_ups[MB_Z_UP]++; - } else if ( Mouse.x_info->z>0 ) { - // z up pressed - Mouse.pressed[MB_Z_UP] = 1; - Mouse.time_went_down[MB_Z_UP]=Mouse.ctime; - Mouse.num_downs[MB_Z_UP]++; - } - if (Mouse.pressed[MB_Z_DOWN]) { - // z down released - Mouse.pressed[MB_Z_DOWN] = 0; - Mouse.time_held_down[MB_Z_DOWN] += Mouse.ctime-Mouse.time_went_down[MB_Z_DOWN]; - Mouse.num_ups[MB_Z_DOWN]++; - } else if ( Mouse.x_info->z<0 ) { - // z down pressed - Mouse.pressed[MB_Z_DOWN] = 1; - Mouse.time_went_down[MB_Z_DOWN]=Mouse.ctime; - Mouse.num_downs[MB_Z_DOWN]++; - } - } - if (m_ax & ME_P_C ) { // pitch changed - if (Mouse.pressed[MB_PITCH_BACKWARD]) { - // pitch backward released - Mouse.pressed[MB_PITCH_BACKWARD] = 0; - Mouse.time_held_down[MB_PITCH_BACKWARD] += Mouse.ctime-Mouse.time_went_down[MB_PITCH_BACKWARD]; - Mouse.num_ups[MB_PITCH_BACKWARD]++; - } else if ( Mouse.x_info->pitch>0 ) { - // pitch backward pressed - Mouse.pressed[MB_PITCH_BACKWARD] = 1; - Mouse.time_went_down[MB_PITCH_BACKWARD]=Mouse.ctime; - Mouse.num_downs[MB_PITCH_BACKWARD]++; - } - if (Mouse.pressed[MB_PITCH_FORWARD]) { - // pitch forward released - Mouse.pressed[MB_PITCH_FORWARD] = 0; - Mouse.time_held_down[MB_PITCH_FORWARD] += Mouse.ctime-Mouse.time_went_down[MB_PITCH_FORWARD]; - Mouse.num_ups[MB_PITCH_FORWARD]++; - } else if ( Mouse.x_info->pitch<0 ) { - // pitch forward pressed - Mouse.pressed[MB_PITCH_FORWARD] = 1; - Mouse.time_went_down[MB_PITCH_FORWARD]=Mouse.ctime; - Mouse.num_downs[MB_PITCH_FORWARD]++; - } - } - - if (m_ax & ME_B_C ) { // bank changed - if (Mouse.pressed[MB_BANK_LEFT]) { - // bank left released - Mouse.pressed[MB_BANK_LEFT] = 0; - Mouse.time_held_down[MB_BANK_LEFT] += Mouse.ctime-Mouse.time_went_down[MB_BANK_LEFT]; - Mouse.num_ups[MB_BANK_LEFT]++; - } else if ( Mouse.x_info->bank>0 ) { - // bank left pressed - Mouse.pressed[MB_BANK_LEFT] = 1; - Mouse.time_went_down[MB_BANK_LEFT]=Mouse.ctime; - Mouse.num_downs[MB_BANK_LEFT]++; - } - if (Mouse.pressed[MB_BANK_RIGHT]) { - // bank right released - Mouse.pressed[MB_BANK_RIGHT] = 0; - Mouse.time_held_down[MB_BANK_RIGHT] += Mouse.ctime-Mouse.time_went_down[MB_BANK_RIGHT]; - Mouse.num_ups[MB_BANK_RIGHT]++; - } else if ( Mouse.x_info->bank<0 ) { - // bank right pressed - Mouse.pressed[MB_BANK_RIGHT] = 1; - Mouse.time_went_down[MB_BANK_RIGHT]=Mouse.ctime; - Mouse.num_downs[MB_BANK_RIGHT]++; - } - } - - if (m_ax & ME_H_C ) { // heading changed - if (Mouse.pressed[MB_HEAD_LEFT]) { - // head left released - Mouse.pressed[MB_HEAD_LEFT] = 0; - Mouse.time_held_down[MB_HEAD_LEFT] += Mouse.ctime-Mouse.time_went_down[MB_HEAD_LEFT]; - Mouse.num_ups[MB_HEAD_LEFT]++; - } else if ( Mouse.x_info->heading>0 ) { - // head left pressed - Mouse.pressed[MB_HEAD_LEFT] = 1; - Mouse.time_went_down[MB_HEAD_LEFT]=Mouse.ctime; - Mouse.num_downs[MB_HEAD_LEFT]++; - } - if (Mouse.pressed[MB_HEAD_RIGHT]) { - // head right released - Mouse.pressed[MB_HEAD_RIGHT] = 0; - Mouse.time_held_down[MB_HEAD_RIGHT] += Mouse.ctime-Mouse.time_went_down[MB_HEAD_RIGHT]; - Mouse.num_ups[MB_HEAD_RIGHT]++; - } else if ( Mouse.x_info->heading<0 ) { - // head right pressed - Mouse.pressed[MB_HEAD_RIGHT] = 1; - Mouse.time_went_down[MB_HEAD_RIGHT]=Mouse.ctime; - Mouse.num_downs[MB_HEAD_RIGHT]++; - } - } - } - -} - - - - -void mouse_handler_end (void) // dummy functions -{ -} -#pragma on (check_stack) - -//-------------------------------------------------------- -// returns 0 if no mouse -// else number of buttons -int mouse_init(int enable_cyberman) -{ - dpmi_real_regs rr; - cyberman_info *ci; -#ifndef __DJGPP__ - struct SREGS sregs; -#endif - union REGS inregs, outregs; - ubyte *Mouse_dos_mem; - - if (Mouse_installed) - return Mouse.num_buttons; - -#ifdef __DJGPP__ - if (_farpeekl(_dos_ds, 0x33 * 4) == 0) { -#else - if (_dos_getvect(0x33) == NULL) { -#endif - // No mouse driver loaded - return 0; - } - - // Reset the mouse driver - memset( &inregs, 0, sizeof(inregs) ); - inregs.w.ax = 0; - int386(0x33, &inregs, &outregs); - if (outregs.w.ax != 0xffff) - return 0; - - Mouse.num_buttons = outregs.w.bx; - Mouse.cyberman = 0; - - // Enable mouse driver - memset( &inregs, 0, sizeof(inregs) ); - inregs.w.ax = 0x0020; - int386(0x33, &inregs, &outregs); - if (outregs.w.ax != 0xffff ) - return 0; - - if ( enable_cyberman ) { - Mouse_dos_mem = dpmi_get_temp_low_buffer( 64 ); - if (Mouse_dos_mem==NULL) { - printf( "Unable to allocate DOS buffer in mouse.c\n" ); - } else { - // Check for Cyberman... - memset( &rr, 0, sizeof(dpmi_real_regs) ); - rr.es = DPMI_real_segment(Mouse_dos_mem); - rr.edx = DPMI_real_offset(Mouse_dos_mem); - rr.eax = 0x53c1; - dpmi_real_int386x( 0x33, &rr ); - if (rr.eax==1) { - // SWIFT functions supported - ci = (cyberman_info *)Mouse_dos_mem; - if (ci->device_type==1) { // Cyberman - Mouse.cyberman = 1; - //printf( "Cyberman mouse detected\n" ); - Mouse.num_buttons = 11; - } - } - } - } - - if (!dpmi_lock_region(&Mouse,sizeof(mouse_info))) { - printf( "Unable to lock mouse data region" ); - exit(1); - } - if (!dpmi_lock_region((void near *)mouse_handler,(char *)mouse_handler_end - (char near *)mouse_handler)) { - printf( "Unable to lock mouse handler" ); - exit(1); - } - - // Install mouse handler -#ifdef __DJGPP__ - { - dpmi_real_regs rregs; - _go32_dpmi_seginfo info; - memset(&rregs, 0, sizeof(rregs)); - info.pm_offset = (unsigned int)&mouse_handler; - if (_go32_dpmi_allocate_real_mode_callback_retf(&info, &handler_regs)) { - printf( "Unable allocate mouse handler callback" ); - exit(1); - } - rregs.eax = 0xC; - rregs.ecx = ME_LB_P|ME_LB_R|ME_RB_P|ME_RB_R|ME_MB_P|ME_MB_R; // watch all 3 button ups/downs - if (Mouse.cyberman) - rregs.ecx |= ME_Z_C| ME_P_C| ME_B_C| ME_H_C; // if using a cyberman, also watch z, pitch, bank, heading. - rregs.edx = info.rm_offset; - rregs.es = info.rm_segment; - dpmi_real_int386x( 0x33, &rregs ); - } -#else - memset( &inregs, 0, sizeof(inregs)); - memset( &sregs, 0, sizeof(sregs)); - inregs.w.ax = 0xC; - inregs.w.cx = ME_LB_P|ME_LB_R|ME_RB_P|ME_RB_R|ME_MB_P|ME_MB_R; // watch all 3 button ups/downs - if (Mouse.cyberman) - inregs.w.cx |= ME_Z_C| ME_P_C| ME_B_C| ME_H_C; // if using a cyberman, also watch z, pitch, bank, heading. - inregs.x.edx = FP_OFF(mouse_handler); - sregs.es = FP_SEG(mouse_handler); - int386x(0x33, &inregs, &outregs, &sregs); -#endif - - Mouse_installed = 1; - - atexit( mouse_close ); - - mouse_flush(); - - return Mouse.num_buttons; -} - - - -void mouse_close() -{ - struct SREGS sregs; - union REGS inregs, outregs; - - if (Mouse_installed) { - Mouse_installed = 0; - // clear mouse handler by setting flags to 0. - memset( &inregs, 0, sizeof(inregs)); - memset( &sregs, 0, sizeof(sregs)); - inregs.w.ax = 0xC; - inregs.w.cx = 0; // disable event handler by setting to zero. - inregs.x.edx = 0; - sregs.es = 0; - int386x(0x33, &inregs, &outregs, &sregs); - } -} - - -void mouse_set_limits( int x1, int y1, int x2, int y2 ) -{ - union REGS inregs, outregs; - - if (!Mouse_installed) return; - - memset( &inregs, 0, sizeof(inregs)); - inregs.w.ax = 0x7; // Set Horizontal Limits for Pointer - inregs.w.cx = x1; - inregs.w.dx = x2; - int386(0x33, &inregs, &outregs); - - memset( &inregs, 0, sizeof(inregs)); - inregs.w.ax = 0x8; // Set Vertical Limits for Pointer - inregs.w.cx = y1; - inregs.w.dx = y2; - int386(0x33, &inregs, &outregs); -} - -void mouse_get_pos( int *x, int *y) -{ - union REGS inregs, outregs; - - if (!Mouse_installed) { - *x = *y = 0; - return; - } - memset( &inregs, 0, sizeof(inregs)); - inregs.w.ax = 0x3; // Get Mouse Position and Button Status - int386(0x33, &inregs, &outregs); - *x = (short)outregs.w.cx; - *y = (short)outregs.w.dx; -} - -void mouse_get_delta( int *dx, int *dy ) -{ - union REGS inregs, outregs; - - if (!Mouse_installed) { - *dx = *dy = 0; - return; - } - - memset( &inregs, 0, sizeof(inregs)); - inregs.w.ax = 0xb; // Read Mouse motion counters - int386(0x33, &inregs, &outregs); - *dx = (short)outregs.w.cx; - *dy = (short)outregs.w.dx; -} - -int mouse_get_btns() -{ - int i; - uint flag=1; - int status = 0; - - if (!Mouse_installed) - return 0; - - for (i=0; ix+8128)*256)/(8064+8128+1)) - 127; - *y = (((ei->y+8128)*256)/(8064+8128+1)) - 127; -} - diff --git a/arch/dos/sgrep.out b/arch/dos/sgrep.out deleted file mode 100644 index 83df7b91..00000000 --- a/arch/dos/sgrep.out +++ /dev/null @@ -1,3 +0,0 @@ -SGREP 2.8 (c) Copyright 1991,92,93 - California Software Design -Searching for [BCD.C] -SGREP 2.8 (c) Copyright 1991,92,93 - California Software Design diff --git a/arch/dos/timer.asm b/arch/dos/timer.asm deleted file mode 100644 index e738fe61..00000000 --- a/arch/dos/timer.asm +++ /dev/null @@ -1,496 +0,0 @@ -[BITS 32] - -[EXTERN _atexit] -[EXTERN ___djgpp_base_address] - -[GLOBAL _timer_get_fixed_seconds] -[GLOBAL _timer_get_fixed_secondsX] -[GLOBAL _timer_get_approx_seconds] -[GLOBAL _timer_set_rate] -[GLOBAL _timer_set_function] -[GLOBAL _timer_set_joyhandler] -[GLOBAL _timer_init] -[GLOBAL _timer_close] - - -[SECTION .data] -TDATA EQU 40h -TCOMMAND EQU 43h -PIC EQU 020h -STACK_SIZE EQU 4096 - -%define df times 3 dw - -TimerData db 0 - dd 0 - dd 65536 - dd 0 - dd 0 - df 0 - df 0 - df 0 - df 0 - dd 0 - db 0 -times STACK_SIZE db 0 - -td_in_timer equ TimerData -td_nested_counter equ td_in_timer+1 -td__timer_cnt equ td_nested_counter+4 -td_dos_timer equ td__timer_cnt+4 -td_joystick_poller equ td_dos_timer+4 -td_user_function equ td_joystick_poller+4 -td_org_interrupt equ td_user_function+6 -td_saved_stack equ td_org_interrupt+6 -td_new_stack equ td_saved_stack+6 -td_tick_count equ td_new_stack+6 -td_Installed equ td_tick_count+4 -td_TimerStack equ td_Installed+1 - - -[SECTION .text] - -TIMER_LOCKED_CODE_START: - -__my_ds dw 0 - -timer_get_stamp64: -; Return a 64-bit stamp that is the number of 1.19Mhz pulses -; since the time was initialized. Returns in EDX:EAX. -; Also, interrupts must be disabled. - - xor eax, eax ; Clear all of EAX - out TCOMMAND, al ; Tell timer to latch - - mov al, 0ah ; Find if interrupt pending - out PIC, al - jmp @ - @: - in al, PIC - and eax, 01b - jz NoInterrupt - - in al, TDATA ; Read in lo byte - mov dl, al - in al, TDATA ; Read in hi byte - mov dh, al - and edx, 0ffffh - mov eax, [td__timer_cnt] - shl eax, 1 - sub eax, edx - - push ebx - mov ebx, eax - mov eax, [td_tick_count] - imul dword [td__timer_cnt] ; edx:eax = Number of 1.19 MHz ticks elapsed... - add eax, ebx - adc edx, 0 - pop ebx - - ret - -NoInterrupt: - in al, TDATA ; Read in lo byte - mov ah, al - in al, TDATA ; Read in hi byte - xchg ah, al ; arrange em correctly - mov edx, [td__timer_cnt] - sub dx, ax ; BX = timer ticks - mov ax, dx - - push ebx - mov ebx, eax - mov eax, [td_tick_count] - imul dword [td__timer_cnt] ; edx:eax = Number of 1.19 MHz ticks elapsed... - add eax, ebx - adc edx, 0 - pop ebx - - ret - - -_timer_get_fixed_seconds: - push ebx - push edx - - cli - call timer_get_stamp64 - sti - -; Timing in fixed point (16.16) seconds. -; Can be used for up to 1000 hours - shld edx, eax, 16 ; Keep 32+11 bits - shl eax, 16 -; edx:eax = number of 1.19Mhz pulses elapsed. - mov ebx, 1193180 - -; Make sure we won't divide overflow. Make time wrap at about 9 hours -sub_again: - sub edx, ebx ; subtract until negative... - jns sub_again ; ...to prevent divide overflow... - add edx, ebx ; ...then add in to get correct value. - div ebx -; eax = fixed point seconds elapsed... - - pop edx - pop ebx - - ret - - -_timer_get_fixed_secondsX: - push ebx - push edx - - call timer_get_stamp64 - -; Timing in fixed point (16.16) seconds. -; Can be used for up to 1000 hours - shld edx, eax, 16 ; Keep 32+11 bits - shl eax, 16 -; edx:eax = number of 1.19Mhz pulses elapsed. - mov ebx, 1193180 - -xsub_again: - sub edx, ebx ; subtract until negative... - jns xsub_again ; ...to prevent divide overflow... - add edx, ebx ; ...then add in to get correct value. - - div ebx -; eax = fixed point seconds elapsed... - - pop edx - pop ebx - - ret - -_timer_get_approx_seconds: - push ebx - push edx - - mov eax, [td_tick_count] - imul dword [td__timer_cnt] ; edx:eax = Number of 1.19 MHz ticks elapsed... - shld edx, eax, 16 ; Keep 32+16 bits, for conversion to fixed point - shl eax, 16 -; edx:eax = number of 1.19Mhz pulses elapsed. - mov ebx, 1193180 - -approx_sub_again: - sub edx, ebx ; subtract until negative... - jns approx_sub_again ; ...to prevent divide overflow... - add edx, ebx ; ...then add in to get correct value. - - div ebx -; eax = fixed point seconds elapsed... - - pop edx - pop ebx - ret - -;---------------------------------------------------------------------------- -;Prototype: extern void timer_set_rate(int count_val); -;---------------------------------------------------------------------------- -_timer_set_rate: - mov eax,[esp+4] -; eax = rate - pushad - -; Make sure eax below or equal to 65535 and above 0 -; if its not, make it be 65536 which is normal dos -; timing. - cmp eax, 65535 - jbe @@ - mov eax, 65536 -@@: - cmp eax, 0 - jne @@@ - mov eax, 65536 -@@@: ; Set the timer rate to eax - cli - mov dword [td_tick_count], 0 - mov [td__timer_cnt], eax - mov al, 34h ; count in binary, mode 2, load low byte then hi byte, counter 0: 00 11 010 0 - out TCOMMAND, al ; Reset PIT channel 0 - mov eax, [td__timer_cnt] - out TDATA, al - mov al, ah - out TDATA, al - sti - popad - ret - -;---------------------------------------------------------------------------- -;Prototype: extern void timer_set_function( void * function ); -;---------------------------------------------------------------------------- -_timer_set_function: -; arg1 = near pointer to user function - push eax - mov eax, [esp+8] ; arg 1 - cli - mov dword [td_user_function+0], eax ; offset - mov word [td_user_function+4], cs ; selector - sti - pop eax - ret - -_timer_set_joyhandler: - mov eax, [esp+4] - cli - mov dword [td_joystick_poller], eax - sti - ret - -;************************************************************************ -;************************************************************************ -;***** ***** -;***** T I M E R _ H A N D L E R ***** -;***** ***** -;************************************************************************ -;************************************************************************ - -timer_handler: - push ds - push es - push eax - - mov ax, [cs:__my_ds] ; Interrupt, so point to our data segment - mov ds, ax - mov es, ax - -; Increment time counter... - inc dword [td_tick_count] - - mov eax, [td__timer_cnt] - add dword [td_dos_timer], eax ; Increment DOS timer - cmp dword [td_dos_timer], 65536 - jb NoChainToOld ; See if we need to chain to DOS 18.2 - and dword [td_dos_timer], 0ffffh - -; -; Call the original DOS handler.... -; - pushfd - call far dword [td_org_interrupt] - - jmp NoReset ;old handler has reset, so we don't - -NoChainToOld: -; Reset controller - mov al, 20h ; Reset interrupt controller - out 20h, al - -NoReset: - cmp byte [td_in_timer], 0 - jne ExitInterrupt - - mov byte [td_in_timer], 1 ; Mark that we're in a timer interrupt... - - ; Reenable interrupts - sti ; Reenable interrupts - - cmp word [td_user_function+4], 0 ; Check the selector... - je NoUserFunction - -; Switch stacks while calling the user-definable function... - pushad - push fs - push gs - mov dword [td_saved_stack+0], esp - mov word [td_saved_stack+4], ss - lss esp, [td_new_stack] ; Switch to new stack - call far dword [td_user_function] ; Call new function - lss esp, [td_saved_stack] ; Switch back to original stack - pop gs - pop fs - popad - -NoUserFunction: - cmp dword [td_joystick_poller], 0 - je NoJoyPolling - mov eax, [td__timer_cnt] - mov dword [td_saved_stack+0], esp - mov word [td_saved_stack+4], ss - lss esp, [td_new_stack] ; Switch to new stack - pusha - push eax - call dword [td_joystick_poller] - pop eax - popa - lss esp, [td_saved_stack] ; Switch back to original stack - -NoJoyPolling: - cli - mov byte [td_in_timer], 0 - -ExitInterrupt: -;;mov al, 20h ; Reset interrupt controller -;;out 20h, al - pop eax - pop es - pop ds - iretd ; Return from timer interrupt - -TIMER_LOCKED_CODE_STOP: - -;************************************************************************ -;************************************************************************ -;***** ***** -;***** T I M E R _ I N I T ***** -;***** ***** -;************************************************************************ -;************************************************************************ - -_timer_init: - pushad - push ds - push es - - cmp byte [td_Installed], 1 - je NEAR AlreadyInstalled - - mov [__my_ds],ds - - mov dword [td__timer_cnt], 65536 ; Set to BIOS's normal 18.2 Hz - mov dword [td_dos_timer], 0 ; clear DOS Interrupt counter - mov dword [td_user_function+0], 0 ; offset of user function - mov word [td_user_function+4], 0 ; selector of user function - - lea eax, [ds:td_TimerStack] ; Use EAX as temp stack pointer - add eax, STACK_SIZE ; Top of stack minus space for saving old ss:esp - mov dword [td_new_stack+0], eax - mov word [td_new_stack+4], ds - - ;--------------- lock data used in interrupt - mov eax, (td_TimerStack-TimerData)+STACK_SIZE ;sizeof timer_data - mov esi, eax - shr esi, 16 - mov edi, eax - and edi, 0ffffh ; si:di = length of region to lock in bytes - mov ebx, TimerData - add ebx, [___djgpp_base_address] - mov ecx, ebx - shr ebx, 16 - and ecx, 0ffffh ; bx:cx = start of linear address to lock - mov eax, 0600h ; DPMI lock address function - int 31h ; call dpmi - jnc @@@@ - int 3 ; LOCK FAILED!! -@@@@: - ;--------------- lock code used in interrupt - mov eax, TIMER_LOCKED_CODE_STOP - sub eax, TIMER_LOCKED_CODE_START - inc eax ; EAX = size of timer interrupt handler - mov esi, eax - shr esi, 16 - mov edi, eax - and edi, 0ffffh ; si:di = length of region to lock in bytes - mov ebx, TIMER_LOCKED_CODE_START - add ebx, [___djgpp_base_address] - mov ecx, ebx - shr ebx, 16 - and ecx, 0ffffh ; bx:cx = start of linear address to lock - mov eax, 0600h ; DPMI lock address function - int 31h ; call dpmi - jnc @@@@@ ;This is getting fun - int 3 ; LOCK FAILED!! -@@@@@: - -;************************************************************** -;******************* SAVE OLD INT8 HANDLER ******************** -;************************************************************** - mov ax,0204h - mov bl,8 - int 31h - mov dword [td_org_interrupt+0],edx - mov word [td_org_interrupt+4],cx - -;************************************************************** -;***************** INSTALL NEW INT8 HANDLER ******************* -;************************************************************** - - cli - - mov al, 34h ; count in binary, mode 2, load low byte then hi byte, counter 0: 00 11 010 0 - out TCOMMAND, al ; Reset PIT channel 0 - mov eax, [td__timer_cnt] - out TDATA, al - mov al, ah - out TDATA, al - - mov dword [td_tick_count], 0 - mov byte [td_Installed],1 - - mov ax,0205h - mov bl,8 - mov edx,timer_handler - mov cx,cs - int 31h - - - sti - push dword _timer_close - call _atexit - add esp,4 - -AlreadyInstalled: - - pop es - pop ds - popad - - ret - -;************************************************************************ -;************************************************************************ -;***** ***** -;***** T I M E R _ C L O S E _ ***** -;***** ***** -;************************************************************************ -;************************************************************************ - -_timer_close: - push eax - push ebx - push ecx - push edx - - cmp byte [td_Installed], 0 - je NotInstalled - mov byte [td_Installed], 0 - -;************************************************************** -;***************** RESTORE OLD INT8 HANDLER ******************* -;************************************************************** - - cli - mov al, 36h ; count in binary, mode 3, load low byte then hi byte, counter 0: 00 11 011 0 - out TCOMMAND, al ; Reser PIT channel 0 - mov ax, 0h - out TDATA, al - mov al, ah - out TDATA, al - - mov ax,0205h - mov bl,8 - mov edx,dword [td_org_interrupt+0] - mov cx,word [td_org_interrupt+4] - int 31h - - sti - - cmp dword [td_nested_counter], 0 - je NoNestedInterrupts - mov eax, [td_nested_counter] - ;int 3 ; Get John!! - -NoNestedInterrupts: - - -NotInstalled: - pop edx - pop ecx - pop ebx - pop eax - - ret - diff --git a/arch/dos/tweak.inc b/arch/dos/tweak.inc deleted file mode 100644 index 4c7222dc..00000000 --- a/arch/dos/tweak.inc +++ /dev/null @@ -1,258 +0,0 @@ -;THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -;SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -;END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -;ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -;IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -;SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -;FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -;CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -;AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -; -; $Source: /cvs/cvsroot/d2x/arch/dos/tweak.inc,v $ -; $Revision: 1.1.1.1 $ -; $Author: bradleyb $ -; $Date: 2001-01-19 03:30:15 $ -; -; Parameters used by modex.asm to set various modex resolutions. -; -; $Log: not supported by cvs2svn $ -; Revision 1.1.1.1 1999/06/14 21:58:45 donut -; Import of d1x 1.37 source. -; -; Revision 1.3 1993/11/16 11:28:09 john -; *** empty log message *** -; -; Revision 1.2 1993/10/15 16:23:18 john -; y -; -; Revision 1.1 1993/09/08 11:41:09 john -; Initial revision -; -; -; - - -; Mode X CRTC register tweaks for various resolutions - -X320Y200 db 00 ; 0e3h ; dot clock - db 02 ; Number of CRTC Registers to update - dw 00014h ; turn off dword mode - dw 0e317h ; turn on byte mode - dw 320 ; width - dw 200 ; height - -X320Y240 db 0e3h ; dot clock - db 10 ; Number of CRTC Registers to update - dw 00d06h ; vertical total - dw 03e07h ; overflow (bit 8 of vertical counts) - dw 04109h ; cell height (2 to double-scan) - dw 0ea10h ; v sync start - dw 0ac11h ; v sync end and protect cr0-cr7 - dw 0df12h ; vertical displayed - dw 00014h ; turn off dword mode - dw 0e715h ; v blank start - dw 00616h ; v blank end - dw 0e317h ; turn on byte mode - dw 320 ; width - dw 240 ; height - -X360Y200 db 0e7h ; dot clock - db 08 ; Number of CRTC Registers to update - dw 06b00h ; horz total - dw 05901h ; horz displayed - dw 05a02h ; start horz blanking - dw 08e03h ; end horz blanking - dw 05e04h ; start h sync - dw 08a05h ; end h sync - dw 00014h ; turn off dword mode - dw 0e317h ; turn on byte mode - dw 360 ; width - dw 200 ; height - - -X360Y240 db 0e7h ; dot clock - db 17 ; Number of CRTC Registers to update - dw 06b00h ; horz total - dw 05901h ; horz displayed - dw 05a02h ; start horz blanking - dw 08e03h ; end horz blanking - dw 05e04h ; start h sync - dw 08a05h ; end h sync - dw 00d06h ; vertical total - dw 03e07h ; overflow (bit 8 of vertical counts) - dw 04109h ; cell height (2 to double-scan) - dw 0ea10h ; v sync start - dw 0ac11h ; v sync end and protect cr0-cr7 - dw 0df12h ; vertical displayed - dw 02d13h ; offset; - dw 00014h ; turn off dword mode - dw 0e715h ; v blank start - dw 00616h ; v blank end - dw 0e317h ; turn on byte mode - dw 360 - dw 240 - -X376Y282 db 0e7h - db 18 - dw 06e00h ; horz total - dw 05d01h ; horz displayed - dw 05e02h ; start horz blanking - dw 09103h ; end horz blanking - dw 06204h ; start h sync - dw 08f05h ; end h sync - dw 06206h ; vertical total - dw 0f007h ; overflow - dw 06109h ; cell height - dw 0310fh ; - dw 03710h ; v sync start - dw 08911h ; v sync end and protect cr0-cr7 - dw 03312h ; vertical displayed - dw 02f13h ; offset - dw 00014h ; turn off dword mode - dw 03c15h ; v blank start - dw 05c16h ; v blank end - dw 0eb17h ; turn on byte mode - dw 376 - dw 282 - - -X320Y400 db 0h ; dot clock - db 03 ; Number of CRTC Registers to update - dw 04009h ; cell height - dw 00014h ; turn off dword mode - dw 0e317h ; turn on byte mode - dw 320 ; width - dw 400 ; height - -X320Y480 db 0e3h ; dotclock - db 10 ; Number of CRTC Registers to update - dw 00d06h ; vertical total - dw 03e07h ; overflow (bit 8 of vertical counts) - dw 04009h ; cell height (2 to double-scan) - dw 0ea10h ; v sync start - dw 0ac11h ; v sync end and protect cr0-cr7 - dw 0df12h ; vertical displayed - dw 00014h ; turn off dword mode - dw 0e715h ; v blank start - dw 00616h ; v blank end - dw 0e317h ; turn on byte mode - dw 320 ; width - dw 480 ; height - -X360Y400 db 0e7h ; dot clock - db 09 ; Number of CRTC Registers to update - dw 06b00h ; horz total - dw 05901h ; horz displayed - dw 05a02h ; start horz blanking - dw 08e03h ; end horz blanking - dw 05e04h ; start h sync - dw 08a05h ; end h sync - dw 04009h ; cell height - dw 00014h ; turn off dword mode - dw 0e317h ; turn on byte mode - dw 360 ; width - dw 400 ; height - -X360Y480 db 0e7h - db 17 - dw 06b00h ; horz total - dw 05901h ; horz displayed - dw 05a02h ; start horz blanking - dw 08e03h ; end horz blanking - dw 05e04h ; start h sync - dw 08a05h ; end h sync - dw 00d06h ; vertical total - dw 03e07h ; overflow - dw 04009h ; cell height - dw 0ea10h ; v sync start - dw 0ac11h ; v sync end and protect cr0-cr7 - dw 0df12h ; vertical displayed - dw 02d13h ; offset - dw 00014h ; turn off dword mode - dw 0e715h ; v blank start - dw 00616h ; v blank end - dw 0e317h ; turn on byte mode - dw 360 - dw 480 - -X360Y360 db 0e7h - db 15 - dw 06b00h ; horz total - dw 05901h ; horz displayed - dw 05a02h ; start horz blanking - dw 08e03h ; end horz blanking - dw 05e04h ; start h sync - dw 08a05h ; end h sync - dw 04009h ; cell height - dw 08810h ; v sync start - dw 08511h ; v sync end and protect cr0-cr7 - dw 06712h ; vertical displayed - dw 02d13h ; offset - dw 00014h ; turn off dword mode - dw 06d15h ; v blank start - dw 0ba16h ; v blank end - dw 0e317h ; turn on byte mode - dw 360 - dw 360 - -X376Y308 db 0e7h - db 18 - dw 06e00h ; horz total - dw 05d01h ; horz displayed - dw 05e02h ; start horz blanking - dw 09103h ; end horz blanking - dw 06204h ; start h sync - dw 08f05h ; end h sync - dw 06206h ; vertical total - dw 00f07h ; overflow - dw 04009h ; - dw 0310fh ; - dw 03710h ; v sync start - dw 08911h ; v sync end and protect cr0-cr7 - dw 03312h ; vertical displayed - dw 02f13h ; offset - dw 00014h ; turn off dword mode - dw 03c15h ; v blank start - dw 05c16h ; v blank end - dw 0e317h ; turn on byte mode - dw 376 - dw 308 - -X376Y564 db 0e7h - db 18 - dw 06e00h ; horz total - dw 05d01h ; horz displayed - dw 05e02h ; start horz blanking - dw 09103h ; end horz blanking - dw 06204h ; start h sync - dw 08f05h ; end h sync - dw 06206h ; vertical total - dw 0f007h ; overflow - dw 06009h ; - dw 0310fh ; - dw 03710h ; v sync start - dw 08911h ; v sync end and protect cr0-cr7 - dw 03312h ; vertical displayed - dw 02f13h ; offset - dw 00014h ; turn off dword mode - dw 03c15h ; v blank start - dw 05c16h ; v blank end - dw 0e317h ; turn on byte mode - dw 376 - dw 564 - -%define LAST_X_MODE 11 - -ModeTable dd X320Y200 - dd X320Y240 - dd X360Y200 - dd X360Y240 - dd X376Y282 - dd X320Y400 - dd X320Y480 - dd X360Y400 - dd X360Y480 - dd X360Y360 - dd X376Y308 - dd X376Y564 diff --git a/arch/dos/vesa.c b/arch/dos/vesa.c deleted file mode 100644 index fd965b50..00000000 --- a/arch/dos/vesa.c +++ /dev/null @@ -1,140 +0,0 @@ -#include -#ifdef __ENV_DJGPP__ - - -#include -#include "gr.h" -#include "grdef.h" -#include "u_dpmi.h" -#include "vesa.h" - -#define SC_INDEX 0x3c4 -#define CRTC_INDEX 0x3d4 -#define CRTC_DATA 0x3d5 - -static int bankshift; -static int lastbank; - -/* this comes from Allegro */ -typedef struct vesa_mode_info -{ - unsigned short ModeAttributes; - unsigned char WinAAttributes; - unsigned char WinBAttributes; - unsigned short WinGranularity; - unsigned short WinSize; - unsigned short WinASegment; - unsigned short WinBSegment; - unsigned long WinFuncPtr; - unsigned short BytesPerScanLine; - unsigned short XResolution; - unsigned short YResolution; - unsigned char XCharSize; - unsigned char YCharSize; - unsigned char NumberOfPlanes; - unsigned char BitsPerPixel; - unsigned char NumberOfBanks; - unsigned char MemoryModel; - unsigned char BankSize; - unsigned char NumberOfImagePages; - unsigned char Reserved_page; - unsigned char RedMaskSize; - unsigned char RedMaskPos; - unsigned char GreenMaskSize; - unsigned char GreenMaskPos; - unsigned char BlueMaskSize; - unsigned char BlueMaskPos; - unsigned char ReservedMaskSize; - unsigned char ReservedMaskPos; - unsigned char DirectColorModeInfo; - unsigned long PhysBasePtr; - unsigned long OffScreenMemOffset; - unsigned short OffScreenMemSize; - unsigned char Reserved[206]; -} __attribute__ ((packed)) vesa_mode_info; - - -int gr_vesa_checkmode(int mode) { - int i; - dpmi_real_regs rregs; - vesa_mode_info *mode_info; - - if (!(mode_info = dpmi_get_temp_low_buffer( 1024 ))) - return 7; - rregs.eax = 0x4f01; - rregs.ecx = mode; - rregs.edi = DPMI_real_offset(mode_info); - rregs.es = DPMI_real_segment(mode_info); - dpmi_real_int386x( 0x10, &rregs ); - if (rregs.eax != 0x4f) - return 5; /* no vesa */ - if (!(mode_info->ModeAttributes & 1)) - return 4; /* unsupported mode */ - - bankshift = 0; - i = mode_info->WinGranularity; - while (i < 64) { - i <<= 1; - bankshift++; - } - if (i != 64) - return 2; /* incompatible window granularity */ - return 0; -} - -int gr_vesa_setmode(int mode) { - int ret; - lastbank = -1; - if ((ret = gr_vesa_checkmode(mode))) - return ret; - asm volatile("int $0x10" : "=a" (ret) : "a" (0x4f02), "b" (mode)); - return (ret == 0x4f) ? 0 : 4; -} - -inline void gr_vesa_setpage(int bank) { - if (bank != lastbank) - asm volatile("int $0x10" - : : "a" (0x4f05), "b" (0), "d" ((lastbank = bank) << bankshift)); -} - -void gr_vesa_incpage() { - gr_vesa_setpage(lastbank + 1); -} - -void gr_vesa_setstart(int col, int row) { - asm volatile("int $0x10" - : : "a" (0x4f07), "b" (0), "c" (col), "d" (row)); -} - -int gr_vesa_setlogical(int line_width) { - int ret; - asm volatile("int $0x10" - : "=c" (ret) : "a" (0x4f07), "b" (0), "c" (line_width)); - return ret; -} - -void gr_vesa_scanline(int x1, int x2, int y, unsigned char color) { - int addr = (y * gr_var_bwidth) + x1; - int left = x2 - x1 + 1; - gr_vesa_setpage(addr >> 16); - addr &= 0xffff; - while (left) { - if (left > (65536 - addr)) { - left -= (65536 - addr); - memset(gr_video_memory + addr, color, 65536 - addr); - addr = 0; - gr_vesa_incpage(); - } else { - memset(gr_video_memory + addr, color, left); - left = 0; - } - } -} - -void gr_vesa_pixel(unsigned char color, unsigned int addr) { - gr_vesa_setpage(addr >> 16); - gr_video_memory[addr & 0xffff] = color; -} - - -#endif // __ENV_DJGPP__ diff --git a/arch/dos/vgaregs.inc b/arch/dos/vgaregs.inc deleted file mode 100644 index fd9f66e4..00000000 --- a/arch/dos/vgaregs.inc +++ /dev/null @@ -1,62 +0,0 @@ -;THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -;SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -;END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -;ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -;IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -;SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -;FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -;CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -;AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -; -; $Source: /cvs/cvsroot/d2x/arch/dos/vgaregs.inc,v $ -; $Revision: 1.1.1.1 $ -; $Author: bradleyb $ -; $Date: 2001-01-19 03:30:15 $ -; -; Readable descriptions of VGA ports. -; -; $Log: not supported by cvs2svn $ -; Revision 1.1.1.1 1999/06/14 21:58:45 donut -; Import of d1x 1.37 source. -; -; Revision 1.2 1993/10/15 16:22:45 john -; *** empty log message *** -; -; Revision 1.1 1993/09/08 11:41:00 john -; Initial revision -; -; -; - - -%define MISC_OUTPUT 03c2h ;Miscellaneous Output register -%define MAP_MASK 02h ;index in SC of Map Mask register -%define READ_MAP 04h ;index in GC of the Read Map register -%define BIT_MASK 08h ;index in GC of Bit Mask register - -%define SC_INDEX 3c4h ;Index register for sequencer ctrl. -%define SC_MAP_MASK 2 ;Number of map mask register - -%define SC_INDEX 3c4h ;Index register for sequencer ctrl. -%define SC_MAP_MASK 2 ;Number of map mask register -%define SC_MEM_MODE 4 ;Number of memory mode register - -%define GC_INDEX 3ceh ;Index register for graphics ctrl. -%define GC_READ_MAP 4 ;Number of read map register -%define GC_GRAPH_MODE 5 ;Number of graphics mode register -%define GC_MISCELL 6 ;Number of miscellaneous register - -%define CRTC_INDEX 3d4h ;Index register for CRT controller -%define CC_MAX_SCAN 9 ;Number of maximum scan line reg. -%define CC_START_HI 0Ch ;Number of start address high register -%define CC_START_LO 0Dh ;Number of start address low register -%define CC_UNDERLINE 14h ;Number of underline register -%define CC_MODE_CTRL 17h ;Number of mode control register -%define CRTC_OFFSET 13h ; CRTC offset register index - -%define DAC_WRITE_ADR 3C8h ;DAC write address -%define DAC_READ_ADR 3C7h ;DAC read address -%define DAC_DATA 3C9h ;DAC data register - -%define VERT_RESCAN 3DAh ;Input status register #1 diff --git a/arch/dos_dpmi.c b/arch/dos_dpmi.c index 9bd503c4..42dbd510 100644 --- a/arch/dos_dpmi.c +++ b/arch/dos_dpmi.c @@ -11,9 +11,20 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ - +/* + * $Source: /cvs/cvsroot/d2x/arch/dos_dpmi.c,v $ + * $Revision: 1.2 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 13:35:08 $ + * + * Dos DPMI + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include -#ifdef __ENV_DJGPP__ +#endif #ifdef __DJGPP__ #define _BORLAND_DOS_REGS 1 @@ -394,5 +405,3 @@ int dpmi_set_pm_handler(unsigned intnum, void far * isr ) return 0; return 1; } - -#endif // __ENV_DJGPP__ diff --git a/arch/dos_findfile.c b/arch/dos_findfile.c index 4db5c8cb..452923b7 100644 --- a/arch/dos_findfile.c +++ b/arch/dos_findfile.c @@ -11,9 +11,23 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ - +/* + * $Source: /cvs/cvsroot/d2x/arch/dos_findfile.c,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-01-31 14:04:44 $ + * + * Dos findfile functions + * + * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/01/29 13:35:08 bradleyb + * Fixed build system, minor fixes + * + */ + +#ifdef HAVE_CONFIG_H #include -#ifdef __ENV_DJGPP__ +#endif #include #include @@ -76,6 +90,7 @@ int FileFindClose(void) } } +/* //returns 0 if no error int GetFileDateTime(int filehandle, FILETIMESTRUCT *ftstruct) @@ -91,5 +106,4 @@ int SetFileDateTime(int filehandle, FILETIMESTRUCT *ftstruct) return _dos_setftime(filehandle, ftstruct->date, ftstruct->time); } - -#endif //__ENV_DJGPP__ +*/ diff --git a/arch/dos_init.c b/arch/dos_init.c index 2143a5b7..f1283704 100644 --- a/arch/dos_init.c +++ b/arch/dos_init.c @@ -1,5 +1,17 @@ +/* + * $Source: /cvs/cvsroot/d2x/arch/dos_init.c,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 13:35:08 $ + * + * Dos initialization + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include -#ifdef __ENV_DJGPP__ +#endif #include #include @@ -295,13 +307,13 @@ void arch_init_start() { } void arch_init() { - if ( !args_find( "-nodoscheck" )) + if ( !FindArg( "-nodoscheck" )) check_dos_version(); - if ( !args_find( "-nofilecheck" )) + if ( !FindArg( "-nofilecheck" )) dos_check_file_handles(5); - if ( !args_find( "-nomemcheck" )) + if ( !FindArg( "-nomemcheck" )) check_memory(); #ifndef NDEBUG @@ -323,35 +335,35 @@ void arch_init() { con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_3); key_init(); - if (!args_find( "-nomouse" )) { + if (!FindArg( "-nomouse" )) { con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_4); - if (args_find( "-nocyberman" )) + if (FindArg( "-nocyberman" )) mouse_init(0); else mouse_init(1); } else { con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_5); } - if (!args_find( "-nojoystick" )) { + if (!FindArg( "-nojoystick" )) { con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_6); joy_init(); - if ( args_find( "-joyslow" )) { + if ( FindArg( "-joyslow" )) { con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_7); joy_set_slow_reading(JOY_SLOW_READINGS); } - if ( args_find( "-joypolled" )) { + if ( FindArg( "-joypolled" )) { con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_8); joy_set_slow_reading(JOY_POLLED_READINGS); } - if ( args_find( "-joybios" )) { + if ( FindArg( "-joybios" )) { con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_9); joy_set_slow_reading(JOY_BIOS_READINGS); } - if ( args_find( "-joynice" )) { + if ( FindArg( "-joynice" )) { con_printf(CON_VERBOSE, "\n%s", "Using nice joystick poller..." ); joy_set_slow_reading(JOY_FRIENDLY_READINGS); } - if ( args_find( "-gameport" )) { + if ( FindArg( "-gameport" )) { if ( init_gameport() ) { joy_set_slow_reading(JOY_BIOS_READINGS); } else { @@ -366,5 +378,3 @@ void arch_init() { div0_init(DM_ERROR); #endif } - -#endif // __ENV_DJGPP__ diff --git a/arch/dos_ipx.c b/arch/dos_ipx.c index 88b23990..d7e66320 100644 --- a/arch/dos_ipx.c +++ b/arch/dos_ipx.c @@ -10,9 +10,172 @@ CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ + +/* + * $Source: /cvs/cvsroot/d2x/arch/dos_ipx.c,v $ + * $Revision: 1.2 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 13:35:08 $ + * + * Routines for IPX communications. + * + * $Log: not supported by cvs2svn $ + * Revision 1.1.1.1 2001/01/19 03:30:15 bradleyb + * Import of d2x-0.0.8 + * + * Revision 1.1.1.1 1999/06/14 21:58:22 donut + * Import of d1x 1.37 source. + * + * Revision 2.10 1995/03/29 17:27:55 john + * Added code to not duplicate broadcasts. + * + * Revision 2.9 1995/03/29 15:32:07 john + * NEatened. + * + * Revision 2.8 1995/03/29 15:07:31 john + * Added network support. + * + * Revision 2.7 1995/03/29 11:22:27 john + * Added broadcasting over a net. + * + * Revision 2.6 1995/03/28 20:05:03 john + * Took away alternate server stuff. + * + * Revision 2.5 1995/03/23 19:14:29 john + * Added better MAX_USERS message. + * + * Revision 2.4 1995/03/23 19:00:02 john + * Added user list capabitly. + * + * Revision 2.3 1995/03/23 12:27:05 john + * Move IPX into bios lib. + * + * Revision 2.2 1995/03/22 19:08:15 john + * Added code to fix sending packets over router... now + * we just need to make broadcasts go over router!! + * + * Revision 2.1 1995/03/21 08:40:16 john + * Ifdef'd out the NETWORK code. + * + * Revision 2.0 1995/02/27 11:30:45 john + * New version 2.0, which has no anonymous unions, builds with + * Watcom 10.0, and doesn't require parsing BITMAPS.TBL. + * + * Revision 1.31 1995/02/16 17:35:03 john + * Added code to allow dynamic socket changing. + * + * Revision 1.30 1995/02/01 21:03:45 john + * Lintified. + * + * Revision 1.29 1995/01/22 14:31:05 john + * Added key.h + * + * Revision 1.28 1995/01/22 14:29:26 john + * Added code to bypass broadcast messages. + * + * Revision 1.27 1995/01/03 13:46:16 john + * Added code that should make ipx work over different servers, + * but ifdef'd it out with SHAREWARE in ipx.c. I haven't tested + * this, and I hope it doesn't introduce net bugs. + * + * Revision 1.26 1994/12/14 11:54:37 rob + * Reduce # of ipx packets. + * + * Revision 1.25 1994/12/11 00:43:28 john + * Locked down DOS ipx buffers... probably not necessary, tho. + * + * Revision 1.24 1994/12/08 15:49:58 rob + * Bumped up the # of ipx packets. + * + * Revision 1.23 1994/12/04 15:23:54 rob + * Reduced packet # constants. + * + * Revision 1.22 1994/11/27 23:12:39 matt + * Made changes for new mprintf calling convention + * + * Revision 1.21 1994/11/19 15:15:19 mike + * remove unused code and data + * + * Revision 1.20 1994/11/10 11:06:07 rob + * Raised number of ipx packets to 64 and buffers to 128 (for 8-way games) + * Removed (commented out) all the spx support stuff. + * + * Revision 1.19 1994/11/07 17:50:12 rob + * Bumped up max_packets and ipx_num_packets to double their previous + * values. + * + * Revision 1.18 1994/11/07 15:39:01 rob + * Removed temporary hacked ipx_send_object function. + * Replaced with a more general thing. + * + * Revision 1.17 1994/11/05 16:08:40 rob + * Made a change necessary for object syncing on rejoin. + * + * Revision 1.16 1994/11/01 15:57:12 rob + * Added support for SPX sockets for critical messages. + * + * Revision 1.15 1994/10/31 19:21:01 rob + * Added a routine for sending objects via ipx. Its a hack and shoukld + * be replaced by something more general time permitting. + * + * Revision 1.14 1994/10/20 14:57:42 john + * Some test stuff. + * + * Revision 1.13 1994/10/20 11:22:45 john + * Tweaked the number of waiting packets. Added code to print + * total packets missed, and to limit the packet send rate to + * 10 packets per second unless firing. + * + * Revision 1.12 1994/10/03 20:50:11 john + * Started adding sound pause functions. + * + * Revision 1.11 1994/09/15 08:54:24 mike + * comment out a mprintf. + * + * Revision 1.10 1994/09/12 19:38:20 john + * Made some stuff that prints to the DOS screen go to the + * mono instead, since it really is debugging info. + * + * Revision 1.9 1994/09/07 13:32:03 john + * Made ipx_close explicitly close the socket we were using, + * because it seems that VLM's don't automatically close them + * like the older NETX stuff did (Going from Novell 3.11 driver + * to 3.12 anyway). + * + * Revision 1.8 1994/09/06 19:29:20 john + * Added trial version of rejoin function. + * + * Revision 1.7 1994/08/09 19:31:50 john + * Networking changes. + * + * Revision 1.6 1994/08/05 16:11:41 john + * Psuedo working version of networking. + * + * Revision 1.5 1994/08/04 19:17:21 john + * Inbetween version of network stuff. + * + * Revision 1.4 1994/07/29 16:08:57 john + * *** empty log message *** + * + * Revision 1.3 1994/07/25 12:33:31 john + * Network "pinging" in. + * + * Revision 1.2 1994/07/20 15:58:28 john + * First installment of ipx stuff. + * + * Revision 1.1 1994/07/19 15:42:00 john + * Initial revision + * + * + */ + +#ifdef HAVE_CONFIG_H #include +#endif -#ifdef __ENV_DJGPP__ +#ifdef RCS +static char rcsid[] = "$Id: dos_ipx.c,v 1.2 2001-01-29 13:35:08 bradleyb Exp $"; +#endif #ifdef __GNUC__ #define _BORLAND_DOS_REGS 1 @@ -749,5 +912,3 @@ void ipx_read_network_file(char * filename) //---} //--- //--- - -#endif // __ENV_DJGPP__ diff --git a/arch/dos_modex.asm b/arch/dos_modex.asm index d85f061e..45442d3f 100644 --- a/arch/dos_modex.asm +++ b/arch/dos_modex.asm @@ -10,13 +10,19 @@ ;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. ; ; $Source: /cvs/cvsroot/d2x/arch/dos_modex.asm,v $ -; $Revision: 1.1.1.1 $ +; $Revision: 1.3 $ ; $Author: bradleyb $ -; $Date: 2001-01-19 03:33:51 $ +; $Date: 2001-01-31 14:04:44 $ ; ; Routines to access ModeX VGA memory ; ; $Log: not supported by cvs2svn $ +; Revision 1.2 2001/01/29 13:35:08 bradleyb +; Fixed build system, minor fixes +; +; Revision 1.1.1.1 2001/01/19 03:30:15 bradleyb +; Import of d2x-0.0.8 +; ; Revision 1.1.1.1 1999/06/14 21:57:56 donut ; Import of d1x 1.37 source. ; diff --git a/arch/dos_timer.asm b/arch/dos_timer.asm index e738fe61..ca355965 100644 --- a/arch/dos_timer.asm +++ b/arch/dos_timer.asm @@ -1,3 +1,15 @@ +; +; $Source: /cvs/cvsroot/d2x/arch/dos_timer.asm,v $ +; $Revision: 1.2 $ +; $Author: bradleyb $ +; $Date: 2001-01-29 13:35:08 $ +; +; DOS timer routines +; +; $Log: not supported by cvs2svn $ +; + + [BITS 32] [EXTERN _atexit] diff --git a/arch/dos_tweak.inc b/arch/dos_tweak.inc index 4523ba0d..17e3895d 100644 --- a/arch/dos_tweak.inc +++ b/arch/dos_tweak.inc @@ -10,13 +10,16 @@ ;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. ; ; $Source: /cvs/cvsroot/d2x/arch/dos_tweak.inc,v $ -; $Revision: 1.1.1.1 $ +; $Revision: 1.2 $ ; $Author: bradleyb $ -; $Date: 2001-01-19 03:33:51 $ +; $Date: 2001-01-29 13:35:08 $ ; ; Parameters used by modex.asm to set various modex resolutions. ; ; $Log: not supported by cvs2svn $ +; Revision 1.1.1.1 2001/01/19 03:30:15 bradleyb +; Import of d2x-0.0.8 +; ; Revision 1.1.1.1 1999/06/14 21:58:45 donut ; Import of d1x 1.37 source. ; diff --git a/arch/dos_vesa.c b/arch/dos_vesa.c index fd965b50..c3f0ddb2 100644 --- a/arch/dos_vesa.c +++ b/arch/dos_vesa.c @@ -1,6 +1,17 @@ +/* + * $Source: /cvs/cvsroot/d2x/arch/dos_vesa.c,v $ + * $Revision: 1.2 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 13:35:08 $ + * + * Dos VESA + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include -#ifdef __ENV_DJGPP__ - +#endif #include #include "gr.h" @@ -135,6 +146,3 @@ void gr_vesa_pixel(unsigned char color, unsigned int addr) { gr_vesa_setpage(addr >> 16); gr_video_memory[addr & 0xffff] = color; } - - -#endif // __ENV_DJGPP__ diff --git a/arch/dos_vgaregs.inc b/arch/dos_vgaregs.inc index 5434bfdd..d78c5ce2 100644 --- a/arch/dos_vgaregs.inc +++ b/arch/dos_vgaregs.inc @@ -10,13 +10,16 @@ ;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. ; ; $Source: /cvs/cvsroot/d2x/arch/dos_vgaregs.inc,v $ -; $Revision: 1.1.1.1 $ +; $Revision: 1.2 $ ; $Author: bradleyb $ -; $Date: 2001-01-19 03:33:51 $ +; $Date: 2001-01-29 13:35:08 $ ; ; Readable descriptions of VGA ports. ; ; $Log: not supported by cvs2svn $ +; Revision 1.1.1.1 2001/01/19 03:30:15 bradleyb +; Import of d2x-0.0.8 +; ; Revision 1.1.1.1 1999/06/14 21:58:45 donut ; Import of d1x 1.37 source. ; diff --git a/arch/include/Makefile.am b/arch/include/Makefile.am new file mode 100644 index 00000000..90229409 --- /dev/null +++ b/arch/include/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST = event.h key.h mouse.h joy.h diff --git a/arch/include/event.h b/arch/include/event.h new file mode 100644 index 00000000..cf2b27cb --- /dev/null +++ b/arch/include/event.h @@ -0,0 +1,27 @@ +/* + * $Source: /cvs/cvsroot/d2x/arch/include/event.h,v $ + * $Revision: 1.1 $ + * $Author: bradleyb $ + * $Date: 2001-01-28 16:10:57 $ + * + * Event header file + * + * $Log: not supported by cvs2svn $ + * + */ + +#ifndef _EVENT_H +#define _EVENT_H + +#ifdef GII_XWIN +#include +#endif + +int event_init(); +void event_poll(); + +#ifdef GII_XWIN +void init_gii_xwin(Display *disp,Window win); +#endif + +#endif diff --git a/input/linux/include/joy.h b/arch/include/joy.h similarity index 71% rename from input/linux/include/joy.h rename to arch/include/joy.h index 0db36753..69b4054b 100644 --- a/input/linux/include/joy.h +++ b/arch/include/joy.h @@ -8,9 +8,26 @@ SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. +COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +/* + * $Source: /cvs/cvsroot/d2x/arch/include/joy.h,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-10-12 00:18:37 $ + * + * Header for joystick functions + * + * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/01/29 13:36:14 bradleyb + * Removed duplicate files + * + * Revision 1.1 2001/01/28 16:10:57 bradleyb + * unified input headers. + * + */ + #ifndef _JOY_H #define _JOY_H @@ -25,46 +42,40 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #define JOY_1_X_AXIS 1 #define JOY_1_Y_AXIS 2 +#define JOY_1_Z_AXIS 4 +#define JOY_1_R_AXIS 16 +#define JOY_1_U_AXIS 32 +#define JOY_1_V_AXIS 64 + +#if defined WINDOWS +#define JOY_NUM_AXES 7 +#elif defined __ENV_LINUX__ +#define JOY_NUM_AXES 5 +#else +#define JOY_NUM_AXES 4 +#endif + +#if defined(_WIN32) && !defined(__MINGW32__) +#define JOY_1_POV 8 +#define JOY_ALL_AXIS (1+2+4+8) +#define JOY_EXT_AXIS (16+32+64) +#else #define JOY_2_X_AXIS 4 #define JOY_2_Y_AXIS 8 #define JOY_ALL_AXIS (1+2+4+8) +#endif -#define JOY_SLOW_READINGS 1 -#define JOY_POLLED_READINGS 2 -#define JOY_BIOS_READINGS 4 -#define JOY_FRIENDLY_READINGS 8 - -#define MAX_AXES 32 -#define MAX_BUTTONS 64 - -#define JOY_NUM_AXES 4 - -typedef struct joystick_device { - int device_number; - int version; - int buffer; - char num_buttons; - char num_axes; -} joystick_device; - -typedef struct joystick_axis { - int value; - int min_val; - int center_val; - int max_val; - int joydev; -} joystick_axis; - -typedef struct joystick_button { - ubyte state; - ubyte last_state; -//changed 6/24/1999 to finally squish the timedown bug - Owen Evans - fix timedown; -//end changed - OE - ubyte downcount; - int num; - int joydev; -} joystick_button; +#define JOY_SLOW_READINGS 1 +#define JOY_POLLED_READINGS 2 +#define JOY_BIOS_READINGS 4 +/* not present in d2src, maybe we don't really need it? */ +#define JOY_FRIENDLY_READINGS 8 + +#ifdef __ENV_LINUX__ +#define MAX_BUTTONS 64 +#else +#define MAX_BUTTONS 20 +#endif //========================================================================== // This initializes the joy and does a "quick" calibration which @@ -73,21 +84,17 @@ typedef struct joystick_button { // joystick was detected, 1 if everything is ok. // joy_init() is called. +#if defined (__NT__) +extern int joy_init(int joy, int spjoy); +extern int joy95_init_stick(int joy, int spjoy); +#else extern int joy_init(); +#endif extern void joy_close(); extern char joy_installed; extern char joy_present; -extern int j_num_axes; -extern int j_num_buttons; - -extern int joy_deadzone; - -extern joystick_device j_joystick[4]; -extern joystick_axis j_axis[MAX_AXES]; -extern joystick_button j_button[MAX_BUTTONS]; - //========================================================================== // The following 3 routines can be used to zero in on better joy // calibration factors. To use them, ask the user to hold the stick @@ -99,8 +106,11 @@ extern joystick_button j_button[MAX_BUTTONS]; // left position is usually always 0,0 on most joys. But, the safest // bet is to do all three, or let the user choose which ones to set. +extern void joy_set_ul(); +extern void joy_set_lr(); extern void joy_set_cen(); + //========================================================================== // This reads the joystick. X and Y will be between -128 and 127. // Takes about 1 millisecond in the worst case when the stick @@ -127,10 +137,7 @@ extern int joy_get_button_down_cnt( int btn ); // it, and held it down for 6 more ticks. The time returned would be 9. extern fix joy_get_button_down_time( int btn ); -extern int j_Update_state (); -extern int j_Get_joydev_axis_number (int all_axis_number); -extern int j_Get_joydev_button_number (int all_button_number); - +extern ubyte joy_read_raw_buttons(); extern ubyte joystick_read_raw_axis( ubyte mask, int * axis ); extern void joy_flush(); extern ubyte joy_get_present_mask(); @@ -138,13 +145,17 @@ extern void joy_set_timer_rate(int max_value ); extern int joy_get_timer_rate(); extern int joy_get_button_state( int btn ); +extern void joy_set_cen_fake(int channel); +extern ubyte joy_read_stick( ubyte masks, int *axis ); extern void joy_get_cal_vals(int *axis_min, int *axis_center, int *axis_max); extern void joy_set_cal_vals(int *axis_min, int *axis_center, int *axis_max); +extern void joy_set_btn_values( int btn, int state, fix timedown, int downcount, int upcount ); extern int joy_get_scaled_reading( int raw, int axn ); extern void joy_set_slow_reading( int flag ); -extern void joy_set_min (int axis_number, int value); -extern void joy_set_center (int axis_number, int value); -extern void joy_set_max (int axis_number, int value); +#if defined(_WIN32) && !defined(__MINGW32__) +extern int joy95_init_stick(int joy, int spjoy); +#endif + #endif diff --git a/arch/dos/include/key.h b/arch/include/key.h similarity index 75% rename from arch/dos/include/key.h rename to arch/include/key.h index ba2937aa..4a6054e0 100644 --- a/arch/dos/include/key.h +++ b/arch/include/key.h @@ -8,84 +8,28 @@ SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. +COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ + /* - * $Source: /cvs/cvsroot/d2x/arch/dos/include/key.h,v $ - * $Revision: 1.1.1.2 $ + * $Source: /cvs/cvsroot/d2x/arch/include/key.h,v $ + * $Revision: 1.2 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:33:52 $ + * $Date: 2001-01-28 16:21:54 $ * * Header for keyboard functions * * $Log: not supported by cvs2svn $ - * Revision 1.1.1.1 1999/06/14 22:00:12 donut - * Import of d1x 1.37 source. - * - * Revision 1.19 1994/10/24 13:58:12 john - * Hacked in support for pause key onto code 0x61. - * - * Revision 1.18 1994/10/21 15:17:10 john - * Added KEY_PRINT_SCREEN - * - * Revision 1.17 1994/08/31 12:22:13 john - * Added KEY_DEBUGGED - * - * Revision 1.16 1994/08/24 18:53:50 john - * Made Cyberman read like normal mouse; added dpmi module; moved - * mouse from assembly to c. Made mouse buttons return time_down. - * - * Revision 1.15 1994/08/18 14:56:16 john - * *** empty log message *** - * - * Revision 1.14 1994/08/08 10:43:24 john - * Recorded when a key was pressed for key_inkey_time. - * - * Revision 1.13 1994/06/17 17:17:28 john - * Added keyd_time_last_key_was_pressed or something like that. - * - * Revision 1.12 1994/04/29 12:14:19 john - * Locked all memory used during interrupts so that program - * won't hang when using virtual memory. - * - * Revision 1.11 1994/02/17 15:57:14 john - * Changed key libary to C. - * - * Revision 1.10 1994/01/31 08:34:09 john - * Fixed reversed lshift/rshift keys. - * - * Revision 1.9 1994/01/18 10:58:17 john - * *** empty log message *** - * - * Revision 1.8 1993/10/16 19:24:43 matt - * Added new function key_clear_times() & key_clear_counts() - * - * Revision 1.7 1993/10/15 10:17:09 john - * added keyd_last_key_pressed and released for use with recorder. - * - * Revision 1.6 1993/10/06 16:20:37 john - * fixed down arrow bug - * - * Revision 1.5 1993/10/04 13:26:42 john - * changed the #defines for scan codes. - * - * Revision 1.4 1993/09/28 11:35:20 john - * added key_peekkey - * - * Revision 1.3 1993/09/20 18:36:43 john - * *** empty log message *** - * - * Revision 1.1 1993/07/10 13:10:39 matt - * Initial revision - * + * Revision 1.1 2001/01/28 05:46:33 bradleyb + * Unified arch headers * */ #ifndef _KEY_H #define _KEY_H -#include "fix.h" #include "pstypes.h" +#include "fix.h" //========================================================================== // This installs the int9 vector and initializes the keyboard in buffered @@ -98,11 +42,11 @@ extern void key_close(); // set keyd_buffer_type to 0 for no key buffering. // set it to 1 and it will buffer scancodes. extern unsigned char keyd_buffer_type; -extern unsigned char keyd_repeat; // 1=allow repeating, 0=dont allow repeat +extern unsigned char keyd_repeat; // 1=allow repeating, 0=dont allow repeat // keyd_editor_mode... 0=game mode, 1=editor mode. // Editor mode makes key_down_time always return 0 if modifiers are down. -extern unsigned char keyd_editor_mode; +extern unsigned char keyd_editor_mode; // Time in seconds when last key was pressed... extern volatile int keyd_time_when_last_pressed; @@ -111,6 +55,7 @@ extern volatile int keyd_time_when_last_pressed; // These are the "buffered" keypress routines. Use them by setting the // "keyd_buffer_type" variable. +extern void key_putkey (unsigned short); // simulates a keystroke extern void key_flush(); // Clears the 256 char buffer extern int key_checkch(); // Returns 1 if a char is waiting extern int key_getch(); // Gets key if one waiting other waits for one. @@ -146,7 +91,6 @@ extern unsigned int key_up_count(int scancode); extern char * key_text[256]; - #define KEY_SHIFTED 0x100 #define KEY_ALTED 0x200 #define KEY_CTRLED 0x400 @@ -192,7 +136,9 @@ extern char * key_text[256]; #define KEY_MINUS 0x0C #define KEY_EQUAL 0x0D +//Note: this is what we normally think of as slash: #define KEY_DIVIDE 0x35 +//Note: this is BACKslash: #define KEY_SLASH 0x2B #define KEY_COMMA 0x33 #define KEY_PERIOD 0x34 diff --git a/arch/dos/include/mouse.h b/arch/include/mouse.h similarity index 59% rename from arch/dos/include/mouse.h rename to arch/include/mouse.h index 43b86b7e..f246d5c5 100644 --- a/arch/dos/include/mouse.h +++ b/arch/include/mouse.h @@ -8,51 +8,23 @@ SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. +COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ + /* - * $Source: /cvs/cvsroot/d2x/arch/dos/include/mouse.h,v $ - * $Revision: 1.1.1.2 $ + * $Source: /cvs/cvsroot/d2x/arch/include/mouse.h,v $ + * $Revision: 1.3 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:33:52 $ + * $Date: 2001-10-12 00:18:37 $ * * Header for mouse functions * * $Log: not supported by cvs2svn $ - * Revision 1.1.1.1 1999/06/14 22:00:13 donut - * Import of d1x 1.37 source. + * Revision 1.2 2001/01/31 16:31:13 bradleyb + * OpenGL support under Cygwin/SDL * - * Revision 1.10 1995/02/02 10:22:29 john - * Added cyberman init parameter. - * - * Revision 1.9 1994/11/18 23:18:09 john - * Changed some shorts to ints. - * - * Revision 1.8 1994/09/13 12:33:49 john - * Added functions to get down count and state. - * - * Revision 1.7 1994/08/29 20:52:20 john - * Added better cyberman support; also, joystick calibration - * value return funcctiionn, - * - * Revision 1.6 1994/08/24 17:54:35 john - * *** empty log message *** - * - * Revision 1.5 1994/08/24 17:51:43 john - * Added transparent cyberman support - * - * Revision 1.4 1993/07/27 09:32:22 john - * *** empty log message *** - * - * Revision 1.3 1993/07/26 10:46:44 john - * added definition for mouse_set_pos - * - * Revision 1.2 1993/07/22 13:07:59 john - * added header for mousesetlimts - * - * Revision 1.1 1993/07/10 13:10:40 matt - * Initial revision - * + * Revision 1.1 2001/01/28 05:46:33 bradleyb + * Unified arch headers * */ @@ -78,21 +50,26 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #define MOUSE_RBTN 2 #define MOUSE_MBTN 4 -//#define NOMOUSE - -#ifndef NOMOUSE - //======================================================================== // Check for mouse driver, reset driver if installed. returns number of // buttons if driver is present. +#ifdef SVGALIB_INPUT +extern int d_mouse_init(int enable_cyberman); /* conflict with */ +#else extern int mouse_init(int enable_cyberman); +#endif +/* changed from int to void */ extern void mouse_set_limits( int x1, int y1, int x2, int y2 ); extern void mouse_flush(); // clears all mice events... //======================================================================== // Shutdowns mouse system. +#ifdef SVGALIB_INPUT +extern void d_mouse_close(); /* conflict with */ +#else extern void mouse_close(); +#endif //======================================================================== extern void mouse_get_pos( int *x, int *y); @@ -111,22 +88,4 @@ extern int mouse_button_down_count(int button); extern int mouse_button_state(int button); -#else -// NOMOUSE -#define mouse_init(a) -1 -#define mouse_set_limits(a,b,c,d) -1 -#define mouse_flush() -#define mouse_close() -#define mouse_get_pos(a,b) -#define mouse_get_delta(a,b) -#define mouse_get_btns() 0 -#define mouse_set_pos(a,b) -#define mouse_get_cyberman_pos(a,b) -#define mouse_button_down_time(a) 0 -#define mouse_button_down_count(a) 0 -#define mouse_button_state(a) 0 - -#endif - - #endif diff --git a/arch/linux/Makefile.am b/arch/linux/Makefile.am index 4c991cae..78ac4cf1 100644 --- a/arch/linux/Makefile.am +++ b/arch/linux/Makefile.am @@ -1,10 +1,4 @@ -ifndef ENV_DJGPP +SUBDIRS = include -noinst_LIBRARIES = libarchlinux.a -INCLUDES = -I $(top_srcdir)/includes -I../../input/sdl/include -I../../input/linux/include -I $(top_srcdir)/main -Iinclude - -libarchlinux_a_SOURCES = \ -init.c ipx_lin.c \ -ipx_bsd.c ipx_udp.c linuxnet.c findfile.c - -endif +EXTRA_DIST = \ +alsadigi.c hmiplay.c hmistub.c ipx_kali.c mono.c serial.c timer.c ukali.c diff --git a/arch/linux/Makefile.in b/arch/linux/Makefile.in deleted file mode 100644 index 48a44fe7..00000000 --- a/arch/linux/Makefile.in +++ /dev/null @@ -1,304 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# 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. - -# 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. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = ../.. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CFLAGS = @CFLAGS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NASM = @NASM@ -NASMFLAGS = @NASMFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -SDL_LIBS = @SDL_LIBS@ -VERSION = @VERSION@ - -noinst_LIBRARIES = libarchlinux.a -INCLUDES = -I $(top_srcdir)/includes -I../../input/sdl/include -I../../input/linux/include -I $(top_srcdir)/main -Iinclude - -libarchlinux_a_SOURCES = init.c ipx_lin.c ipx_bsd.c ipx_udp.c linuxnet.c findfile.c - -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../../conf.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I../.. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -libarchlinux_a_LIBADD = -libarchlinux_a_OBJECTS = init.o ipx_lin.o ipx_bsd.o ipx_udp.o \ -linuxnet.o findfile.o -AR = ar -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -DEP_FILES = .deps/findfile.P .deps/init.P .deps/ipx_bsd.P \ -.deps/ipx_lin.P .deps/ipx_udp.P .deps/linuxnet.P -SOURCES = $(libarchlinux_a_SOURCES) -OBJECTS = $(libarchlinux_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu arch/linux/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -.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: - -libarchlinux.a: $(libarchlinux_a_OBJECTS) $(libarchlinux_a_DEPENDENCIES) - -rm -f libarchlinux.a - $(AR) cru libarchlinux.a $(libarchlinux_a_OBJECTS) $(libarchlinux_a_LIBADD) - $(RANLIB) libarchlinux.a - -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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - 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 = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = arch/linux - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu arch/linux/Makefile - @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 - -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 - @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 -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -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-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-depend mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - 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-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags 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 \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -ifndef ENV_DJGPP - -# 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/arch/linux/findfile.c b/arch/linux/findfile.c deleted file mode 100644 index 6fcb350f..00000000 --- a/arch/linux/findfile.c +++ /dev/null @@ -1,58 +0,0 @@ -#include -#ifdef __ENV_LINUX__ - -#include -#include -#include -#include "findfile.h" -#include "u_mem.h" -#include "error.h" - -/* KLUDGE ALERT: evil globals */ -static glob_t glob_a; -static int glob_whichfile; - -int FileFindFirst(char *search_str, FILEFINDSTRUCT *ffstruct) -{ - int r; - char *t; - - Assert(search_str != NULL); - Assert(ffstruct != NULL); - - r = glob(search_str, 0, NULL, &glob_a); - if (r == GLOB_NOMATCH) return -1; - - glob_whichfile = 0; - - t = strrchr(glob_a.gl_pathv[glob_whichfile], '/'); - if (t == NULL) t = glob_a.gl_pathv[glob_whichfile]; else t++; - strncpy(ffstruct->name, t, 255); - ffstruct->size = strlen(ffstruct->name); - - return 0; -} - -int FileFindNext(FILEFINDSTRUCT *ffstruct) -{ - char *t; - - glob_whichfile++; - - if (glob_whichfile >= glob_a.gl_pathc) return -1; - - t = strrchr(glob_a.gl_pathv[glob_whichfile], '/'); - if (t == NULL) t = glob_a.gl_pathv[glob_whichfile]; else t++; - strncpy(ffstruct->name, t, 255); - ffstruct->size = strlen(ffstruct->name); - return 0; -} - -int FileFindClose(void) -{ - globfree(&glob_a); - return 0; -} - - -#endif // __ENV_LINUX__ diff --git a/arch/linux/include/Makefile.am b/arch/linux/include/Makefile.am new file mode 100644 index 00000000..4686107b --- /dev/null +++ b/arch/linux/include/Makefile.am @@ -0,0 +1,3 @@ +EXTRA_DIST = \ +ipx_bsd.h ipx_drv.h ipx_hlpr.h ipx_kali.h ipx_ld.h ipx_lin.h ipx_udp.h \ +music.h serial.h ukali.h diff --git a/arch/linux/init.c b/arch/linux/init.c deleted file mode 100644 index 41330ae6..00000000 --- a/arch/linux/init.c +++ /dev/null @@ -1,51 +0,0 @@ -// linux init.c - added Matt Mueller 9/6/98 -#include -#ifdef __ENV_LINUX__ - -#include -#include -#include "pstypes.h" -#include "console.h" -#include "text.h" -#include "event.h" -#include "error.h" -#include "joy.h" -#include "args.h" - -extern void arch_sdl_init(); -extern void arch_svgalib_init(); -extern void key_init(); -extern int com_init(); -extern void timer_init(); - -void arch_init_start() -{ - -} - -void arch_init() -{ - // Initialise the library - arch_sdl_init(); -#ifdef __SVGALIB__ - arch_svgalib_init(); -#endif - if (!args_find( "-nojoystick" )) { - con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_6); - joy_init(); - } - //added 06/09/99 Matt Mueller - fix nonetwork compile -#ifdef NETWORK - //end addition -MM -//added on 10/19/98 by Victor Rachels to add serial support (from DPH) - if(!(args_find("-noserial"))) - com_init(); -//end this section addition - Victor - //added 06/09/99 Matt Mueller - fix nonetwork compile -#endif - //end addition -MM - key_init(); -} - - -#endif // __ENV_LINUX__ diff --git a/arch/linux/ipx_bsd.c b/arch/linux/ipx_bsd.c deleted file mode 100644 index de7f6710..00000000 --- a/arch/linux/ipx_bsd.c +++ /dev/null @@ -1,230 +0,0 @@ -/* IPX driver using BSD style sockets */ -/* Mostly taken from dosemu */ -#include -#ifdef __ENV_LINUX__ -#ifdef NETWORK - -#include -#include -#include -#include - -#ifdef HAVE_NETIPX_IPX_H -#include -#else -# include -# ifndef IPX_TYPE -# define IPX_TYPE 1 -# endif -#endif - -#include -#include -#include - -#include "pstypes.h" -#include "ipx_drv.h" -#include "ipx_bsd.h" - -#ifndef DOSEMU -#include "mono.h" -#define n_printf(format, args...) mprintf((1, format, ## args)) -#define enter_priv_on() -#define leave_priv_setting() -#endif - -static int ipx_bsd_GetMyAddress( void ) -{ - int sock; - struct sockaddr_ipx ipxs; - struct sockaddr_ipx ipxs2; - int len; - int i; - - sock=socket(AF_IPX,SOCK_DGRAM,PF_IPX); - if(sock==-1) - { - n_printf("IPX: could not open socket in GetMyAddress\n"); - return(-1); - } - - /* bind this socket to network 0 */ - ipxs.sipx_family=AF_IPX; -#ifdef IPX_MANUAL_ADDRESS - memcpy(&ipxs.sipx_network, ipx_MyAddress, 4); -#else - ipxs.sipx_network=0; -#endif - ipxs.sipx_port=0; - - if(bind(sock,(struct sockaddr *)&ipxs,sizeof(ipxs))==-1) - { - n_printf("IPX: could bind to network 0 in GetMyAddress\n"); - close( sock ); - return(-1); - } - - len = sizeof(ipxs2); - if (getsockname(sock,(struct sockaddr *)&ipxs2,&len) < 0) { - n_printf("IPX: could not get socket name in GetMyAddress\n"); - close( sock ); - return(-1); - } - - memcpy(ipx_MyAddress, &ipxs2.sipx_network, 4); - for (i = 0; i < 6; i++) { - ipx_MyAddress[4+i] = ipxs2.sipx_node[i]; - } - close( sock ); - return(0); -} - -static int ipx_bsd_OpenSocket(ipx_socket_t *sk, int port) -{ - int sock; /* sock here means Linux socket handle */ - int opt; - struct sockaddr_ipx ipxs; - int len; - struct sockaddr_ipx ipxs2; - - /* DANG_FIXTHIS - kludge to support broken linux IPX stack */ - /* need to convert dynamic socket open into a real socket number */ -/* if (port == 0) { - n_printf("IPX: using socket %x\n", nextDynamicSocket); - port = nextDynamicSocket++; - } -*/ - /* do a socket call, then bind to this port */ - sock = socket(AF_IPX, SOCK_DGRAM, PF_IPX); - if (sock == -1) { - n_printf("IPX: could not open IPX socket.\n"); - return -1; - } - -#ifdef DOSEMU - opt = 1; - /* turn on socket debugging */ - if (d.network) { - enter_priv_on(); - if (setsockopt(sock, SOL_SOCKET, SO_DEBUG, &opt, sizeof(opt)) == -1) { - leave_priv_setting(); - n_printf("IPX: could not set socket option for debugging.\n"); - return -1; - } - leave_priv_setting(); - } -#endif - opt = 1; - /* Permit broadcast output */ - enter_priv_on(); - if (setsockopt(sock, SOL_SOCKET, SO_BROADCAST, - &opt, sizeof(opt)) == -1) { - leave_priv_setting(); - n_printf("IPX: could not set socket option for broadcast.\n"); - return -1; - } -#ifdef DOSEMU - /* allow setting the type field in the IPX header */ - opt = 1; -#if 0 /* this seems to be wrong: IPX_TYPE can only be set on level SOL_IPX */ - if (setsockopt(sock, SOL_SOCKET, IPX_TYPE, &opt, sizeof(opt)) == -1) { -#else - /* the socket _is_ an IPX socket, hence it first passes ipx_setsockopt() - * in file linux/net/ipx/af_ipx.c. This one handles SOL_IPX itself and - * passes SOL_SOCKET-levels down to sock_setsockopt(). - * Hence I guess the below is correct (can somebody please verify this?) - * -- Hans, June 14 1997 - */ - if (setsockopt(sock, SOL_IPX, IPX_TYPE, &opt, sizeof(opt)) == -1) { -#endif - leave_priv_setting(); - n_printf("IPX: could not set socket option for type.\n"); - return -1; - } -#endif - ipxs.sipx_family = AF_IPX; - ipxs.sipx_network = *((unsigned int *)&ipx_MyAddress[0]); -/* ipxs.sipx_network = htonl(MyNetwork); */ - bzero(ipxs.sipx_node, 6); /* Please fill in my node name */ - ipxs.sipx_port = htons(port); - - /* now bind to this port */ - if (bind(sock, (struct sockaddr *) &ipxs, sizeof(ipxs)) == -1) { - n_printf("IPX: could not bind socket to address\n"); - close( sock ); - leave_priv_setting(); - return -1; - } - - if( port==0 ) { - len = sizeof(ipxs2); - if (getsockname(sock,(struct sockaddr *)&ipxs2,&len) < 0) { - n_printf("IPX: could not get socket name in IPXOpenSocket\n"); - close( sock ); - leave_priv_setting(); - return -1; - } else { - port = htons(ipxs2.sipx_port); - n_printf("IPX: opened dynamic socket %04x\n", port); - } - } - leave_priv_setting(); - sk->fd = sock; - sk->socket = port; - return 0; -} - -static void ipx_bsd_CloseSocket(ipx_socket_t *mysock) { - /* now close the file descriptor for the socket, and free it */ - n_printf("IPX: closing file descriptor on socket %x\n", mysock->socket); - close(mysock->fd); -} - -static int ipx_bsd_SendPacket(ipx_socket_t *mysock, IPXPacket_t *IPXHeader, - u_char *data, int dataLen) { - struct sockaddr_ipx ipxs; - - ipxs.sipx_family = AF_IPX; - /* get destination address from IPX packet header */ - memcpy(&ipxs.sipx_network, IPXHeader->Destination.Network, 4); - /* if destination address is 0, then send to my net */ - if (ipxs.sipx_network == 0) { - ipxs.sipx_network = *((unsigned int *)&ipx_MyAddress[0]); -/* ipxs.sipx_network = htonl(MyNetwork); */ - } - memcpy(&ipxs.sipx_node, IPXHeader->Destination.Node, 6); - memcpy(&ipxs.sipx_port, IPXHeader->Destination.Socket, 2); - ipxs.sipx_type = IPXHeader->PacketType; - /* ipxs.sipx_port=htons(0x452); */ - return sendto(mysock->fd, data, dataLen, 0, - (struct sockaddr *) &ipxs, sizeof(ipxs)); -} - -static int ipx_bsd_ReceivePacket(ipx_socket_t *s, char *buffer, int bufsize, - struct ipx_recv_data *rd) { - int sz, size; - struct sockaddr_ipx ipxs; - - sz = sizeof(ipxs); - if ((size = recvfrom(s->fd, buffer, bufsize, 0, - (struct sockaddr *) &ipxs, &sz)) <= 0) - return size; - memcpy(rd->src_network, &ipxs.sipx_network, 4); - memcpy(rd->src_node, ipxs.sipx_node, 6); - rd->src_socket = ipxs.sipx_port; - rd->dst_socket = s->socket; - rd->pkt_type = ipxs.sipx_type; - - return size; -} - -struct ipx_driver ipx_bsd = { - ipx_bsd_GetMyAddress, - ipx_bsd_OpenSocket, - ipx_bsd_CloseSocket, - ipx_bsd_SendPacket, - ipx_bsd_ReceivePacket, - ipx_general_PacketReady -}; -#endif // NETWORK -#endif // __ENV_LINUX__ diff --git a/arch/linux/ipx_lin.c b/arch/linux/ipx_lin.c deleted file mode 100644 index 459d4204..00000000 --- a/arch/linux/ipx_lin.c +++ /dev/null @@ -1,218 +0,0 @@ -#include - -#ifdef __ENV_LINUX__ - -#ifdef NETWORK -#include -#include -#include -#include - -#ifdef HAVE_NETIPX_IPX_H -#include -#else -# include -# ifndef IPX_TYPE -# define IPX_TYPE 1 -# endif -#endif - -#include -#include -#include -#include "pstypes.h" - -#include "ipx_ld.h" -#include "ipx_hlpr.h" -#include "ipx_lin.h" - -extern unsigned char ipx_MyAddress[10]; - -int -ipx_linux_GetMyAddress( void ) -{ - int sock; - struct sockaddr_ipx ipxs; - struct sockaddr_ipx ipxs2; - int len; - int i; - - sock=socket(AF_IPX,SOCK_DGRAM,PF_IPX); - if(sock==-1) - { - n_printf("IPX: could not open socket in GetMyAddress\n"); - return(-1); - } - - /* bind this socket to network 0 */ - ipxs.sipx_family=AF_IPX; -#ifdef IPX_MANUAL_ADDRESS - memcpy(&ipxs.sipx_network, ipx_MyAddress, 4); -#else - ipxs.sipx_network=0; -#endif - ipxs.sipx_port=0; - - if(bind(sock,(struct sockaddr *)&ipxs,sizeof(ipxs))==-1) - { - n_printf("IPX: could bind to network 0 in GetMyAddress\n"); - close( sock ); - return(-1); - } - - len = sizeof(ipxs2); - if (getsockname(sock,(struct sockaddr *)&ipxs2,&len) < 0) { - n_printf("IPX: could not get socket name in GetMyAddress\n"); - close( sock ); - return(-1); - } - - memcpy(ipx_MyAddress, &ipxs2.sipx_network, 4); - for (i = 0; i < 6; i++) { - ipx_MyAddress[4+i] = ipxs2.sipx_node[i]; - } - close( sock ); - return(0); -} - -int -ipx_linux_OpenSocket(ipx_socket_t *sk, int port) -{ - int sock; /* sock here means Linux socket handle */ - int opt; - struct sockaddr_ipx ipxs; - int len; - struct sockaddr_ipx ipxs2; - - /* DANG_FIXTHIS - kludge to support broken linux IPX stack */ - /* need to convert dynamic socket open into a real socket number */ -/* if (port == 0) { - n_printf("IPX: using socket %x\n", nextDynamicSocket); - port = nextDynamicSocket++; - } -*/ - /* do a socket call, then bind to this port */ - sock = socket(AF_IPX, SOCK_DGRAM, PF_IPX); - if (sock == -1) { - n_printf("IPX: could not open IPX socket.\n"); - return -1; - } - -#ifdef DOSEMU - opt = 1; - /* turn on socket debugging */ - if (d.network) { - enter_priv_on(); - if (setsockopt(sock, SOL_SOCKET, SO_DEBUG, &opt, sizeof(opt)) == -1) { - leave_priv_setting(); - n_printf("IPX: could not set socket option for debugging.\n"); - return -1; - } - leave_priv_setting(); - } -#endif - opt = 1; - /* Permit broadcast output */ - enter_priv_on(); - if (setsockopt(sock, SOL_SOCKET, SO_BROADCAST, - &opt, sizeof(opt)) == -1) { - leave_priv_setting(); - n_printf("IPX: could not set socket option for broadcast.\n"); - return -1; - } -#ifdef DOSEMU - /* allow setting the type field in the IPX header */ - opt = 1; -#if 0 /* this seems to be wrong: IPX_TYPE can only be set on level SOL_IPX */ - if (setsockopt(sock, SOL_SOCKET, IPX_TYPE, &opt, sizeof(opt)) == -1) { -#else - /* the socket _is_ an IPX socket, hence it first passes ipx_setsockopt() - * in file linux/net/ipx/af_ipx.c. This one handles SOL_IPX itself and - * passes SOL_SOCKET-levels down to sock_setsockopt(). - * Hence I guess the below is correct (can somebody please verify this?) - * -- Hans, June 14 1997 - */ - if (setsockopt(sock, SOL_IPX, IPX_TYPE, &opt, sizeof(opt)) == -1) { -#endif - leave_priv_setting(); - n_printf("IPX: could not set socket option for type.\n"); - return -1; - } -#endif - ipxs.sipx_family = AF_IPX; - ipxs.sipx_network = *((unsigned int *)&ipx_MyAddress[0]); -/* ipxs.sipx_network = htonl(MyNetwork); */ - bzero(ipxs.sipx_node, 6); /* Please fill in my node name */ - ipxs.sipx_port = htons(port); - - /* now bind to this port */ - if (bind(sock, (struct sockaddr *) &ipxs, sizeof(ipxs)) == -1) { - n_printf("IPX: could not bind socket to address\n"); - close( sock ); - leave_priv_setting(); - return -1; - } - - if( port==0 ) { - len = sizeof(ipxs2); - if (getsockname(sock,(struct sockaddr *)&ipxs2,&len) < 0) { - n_printf("IPX: could not get socket name in IPXOpenSocket\n"); - close( sock ); - leave_priv_setting(); - return -1; - } else { - port = htons(ipxs2.sipx_port); - n_printf("IPX: opened dynamic socket %04x\n", port); - } - } - leave_priv_setting(); - sk->fd = sock; - sk->socket = port; - return 0; -} - -void ipx_linux_CloseSocket(ipx_socket_t *mysock) { - /* now close the file descriptor for the socket, and free it */ - n_printf("IPX: closing file descriptor on socket %x\n", mysock->socket); - close(mysock->fd); -} - -int ipx_linux_SendPacket(ipx_socket_t *mysock, IPXPacket_t *IPXHeader, - u_char *data, int dataLen) { - struct sockaddr_ipx ipxs; - - ipxs.sipx_family = AF_IPX; - /* get destination address from IPX packet header */ - memcpy(&ipxs.sipx_network, IPXHeader->Destination.Network, 4); - /* if destination address is 0, then send to my net */ - if (ipxs.sipx_network == 0) { - ipxs.sipx_network = *((unsigned int *)&ipx_MyAddress[0]); -/* ipxs.sipx_network = htonl(MyNetwork); */ - } - memcpy(&ipxs.sipx_node, IPXHeader->Destination.Node, 6); - memcpy(&ipxs.sipx_port, IPXHeader->Destination.Socket, 2); - ipxs.sipx_type = IPXHeader->PacketType; - /* ipxs.sipx_port=htons(0x452); */ - return sendto(mysock->fd, data, dataLen, 0, - (struct sockaddr *) &ipxs, sizeof(ipxs)); -} - -int ipx_linux_ReceivePacket(ipx_socket_t *s, char *buffer, int bufsize, - struct ipx_recv_data *rd) { - int sz, size; - struct sockaddr_ipx ipxs; - - sz = sizeof(ipxs); - if ((size = recvfrom(s->fd, buffer, bufsize, 0, - (struct sockaddr *) &ipxs, &sz)) <= 0) - return size; - memcpy(rd->src_network, &ipxs.sipx_network, 4); - memcpy(rd->src_node, ipxs.sipx_node, 6); - rd->src_socket = ipxs.sipx_port; - rd->dst_socket = s->socket; - rd->pkt_type = ipxs.sipx_type; - - return size; -} -#endif // NETWORK -#endif // __ENV_LINUX__ diff --git a/arch/linux/ipx_udp.c b/arch/linux/ipx_udp.c deleted file mode 100644 index 48a11250..00000000 --- a/arch/linux/ipx_udp.c +++ /dev/null @@ -1,593 +0,0 @@ -/* IPX driver for native Linux TCP/IP networking (UDP implementation) - * Version 0.99.2 - * Contact Jan [Lace] Kratochvil for assistance - * (no "It somehow doesn't work! What should I do?" complaints, please) - * Special thanks to Vojtech Pavlik for testing. - * - * Also you may see KIX - KIX kix out KaliNix (in Linux-Linux only): - * http://atrey.karlin.mff.cuni.cz/~short/sw/kix.c.gz - * - * Primarily based on ipx_kali.c - "IPX driver for KaliNix interface" - * which is probably mostly by Jay Cotton . - * Parts shamelessly stolen from my KIX v0.99.2 and GGN v0.100 - * - * Changes: - * -------- - * 0.99.1 - now the default broadcast list also contains all point-to-point - * links with their destination peer addresses - * 0.99.2 - commented a bit :-) - * - now adds to broadcast list each host it gets some packet from - * which is already not covered by local physical ethernet broadcast - * - implemented short-signature packet format - * - compatibility mode for old D1X releases due to the previous bullet - * - * Configuration: - * -------------- - * No network server software is needed, neither KIX nor KaliNIX. - * - * Add command line argument "-udp". In default operation D1X will send - * broadcasts too all the local interfaces found. But you may also use - * additional parameter specified after "-udp" to modify the default - * broadcasting style and UDP port numbers binding: - * - * ./d1x -udp [@SHIFT]=HOST_LIST Broadcast ONLY to HOST_LIST - * ./d1x -udp [@SHIFT]+HOST_LIST Broadcast both to local ifaces & to HOST_LIST - * - * HOST_LIST is a comma (',') separated list of HOSTs: - * HOST is an IPv4 address (so-called quad like 192.168.1.2) or regular hostname - * HOST can also be in form 'address:SHIFT' - * SHIFT sets the UDP port base offset (e.g. +2), can be used to run multiple - * clients on one host simultaneously. This SHIFT has nothing to do - * with the dynamic-sockets (PgUP/PgDOWN) option in Descent, it's another - * higher-level differentiation option. - * - * Examples: - * --------- - * ./d1x -udp - * - Run D1X to participate in normal local network (Linux only, of course) - * - * ./d1x -udp @1=localhost:2 & ./d1x -udp @2=localhost:1 - * - Run two clients simultaneously fighting each other (only each other) - * - * ./d1x -udp =192.168.4.255 - * - Run distant Descent which will participate with remote network - * 192.168.4.0 with netmask 255.255.255.0 (broadcast has 192.168.4.255) - * - You'll have to also setup hosts in that network accordingly: - * ./d1x -udp +UPPER_DISTANT_MACHINE_NAME - * - * Have fun! - */ - -#include -#ifdef __ENV_LINUX__ -#ifdef NETWORK -#include -#include -#include /* for htons & co. */ -#include -#include -#include -#include -#include -#include -#include - -#include "ipx_drv.h" -#include "args.h" - -extern unsigned char ipx_MyAddress[10]; - -// #define UDPDEBUG - -#define UDP_BASEPORT 28342 -#define PORTSHIFT_TOLERANCE 0x100 -#define MAX_PACKETSIZE 8192 - -/* Packet format: first is the signature { 0xD1,'X' } which can be also - * { 'D','1','X','u','d','p'} for old-fashioned packets. - * Then follows virtual socket number (as changed during PgDOWN/PgUP) - * in network-byte-order as 2 bytes (u_short). After such 4/8 byte header - * follows raw data as communicated with D1X network core functions. - */ - -// Length HAS TO BE 6! -#define D1Xudp "D1Xudp" -// Length HAS TO BE 2! -#define D1Xid "\xD1X" - -static int open_sockets = 0; -static int dynamic_socket = 0x401; -static const int val_one=1; - -/* OUR port. Can be changed by "@X[+=]..." argument (X is the shift value) - */ - -static int baseport=UDP_BASEPORT; - -/* Have we some old D1X in network and have we to maintain compatibility? - * FIXME: Following scenario is braindead: - * A (NEW) , B (OLD) , C (NEW) - * host A) We start new D1X. A-newcomm, B-none , C-none - * host B) We start OLD D1X. A-newcomm, B-oldcomm, C-none - * Now host A hears host B and switches: A-oldcomm, B-oldcomm, C-none - * host C) We start new D1X. A-oldcomm, B-oldcomm, C-newcomm - * Now host C hears host A/B and switches: A-oldcomm, B-oldcomm, C-oldcomm - * Now host B finishes: A-oldcomm, B-none , C-oldcomm - * - * But right now we have hosts A and C, both new code equipped but - * communicating wastefully by the OLD protocol! Bummer. - */ - -static char compatibility=0; - -static int have_empty_address() { - int i; - for (i = 0; i < 10 && !ipx_MyAddress[i]; i++) ; - return i == 10; -} - -#define MSGHDR "IPX_udp: " - -static void msg(const char *fmt,...) -{ -va_list ap; - fputs(MSGHDR,stdout); - va_start(ap,fmt); - vprintf(fmt,ap); - va_end(ap); - putchar('\n'); -} - -static void chk(void *p) -{ - if (p) return; - msg("FATAL: Virtual memory exhausted!"); - exit(EXIT_FAILURE); -} - -#define FAIL(m...) do { msg(#m); return -1; } while (0) - -/* Find as much as MAX_BRDINTERFACES during local iface autoconfiguration. - * Note that more interfaces can be added during manual configuration - * or host-received-packet autoconfiguration - */ - -#define MAX_BRDINTERFACES 16 - -/* We require the interface to be UP and RUNNING to accept it. - */ - -#define IF_REQFLAGS (IFF_UP|IFF_RUNNING) - -/* We reject any interfaces declared as LOOPBACK type. - */ -#define IF_NOTFLAGS (IFF_LOOPBACK) - -static struct sockaddr_in *broads,broadmasks[MAX_BRDINTERFACES]; -static int broadnum,masksnum,broadsize; - -/* We'll check whether the "broads" array of destination addresses is now - * full and so needs expanding. - */ - -static void chkbroadsize(void) -{ - if (broadnumsin_family!=AF_INET || sinmp->sin_family!=AF_INET) continue; - broads[j]=*sinp; - broads[j].sin_port=UDP_BASEPORT; //FIXME: No possibility to override from cmdline - broadmasks[j]=*sinmp; - j++; - } - broadnum=j; - masksnum=j; - return(0); -} - -#define addreq(a,b) ((a).sin_port==(b).sin_port&&(a).sin_addr.s_addr==(b).sin_addr.s_addr) - -/* Previous function addiflist() can (and probably will) report multiple - * same addresses. On some Linux boxes is present both device "eth0" and - * "dummy0" with the same IP addreesses - we'll filter it here. - */ - -static void unifyiflist(void) -{ -int d=0,s,i; - - for (s=0;s=s) broads[d++]=broads[s]; - } - broadnum=d; -} - -static unsigned char qhbuf[6]; - -/* Parse PORTSHIFT numeric parameter - */ - -static void portshift(const char *cs) -{ -long port; -unsigned short ports=0; - - port=atol(cs); - if (port<-PORTSHIFT_TOLERANCE || port>+PORTSHIFT_TOLERANCE) - msg("Invalid portshift in \"%s\", tolerance is +/-%d",cs,PORTSHIFT_TOLERANCE); - else ports=htons(port); - memcpy(qhbuf+4,&ports,2); -} - -/* Do hostname resolve on name "buf" and return the address in buffer "qhbuf". - */ -static unsigned char *queryhost(char *buf) -{ -struct hostent *he; -char *s; -char c=0; - - if ((s=strrchr(buf,':'))) { - c=*s; - *s='\0'; - portshift(s+1); - } - else memset(qhbuf+4,0,2); - he=gethostbyname((char *)buf); - if (s) *s=c; - if (!he) { - msg("Error resolving my hostname \"%s\"",buf); - return(NULL); - } - if (he->h_addrtype!=AF_INET || he->h_length!=4) { - msg("Error parsing resolved my hostname \"%s\"",buf); - return(NULL); - } - if (!*he->h_addr_list) { - msg("My resolved hostname \"%s\" address list empty",buf); - return(NULL); - } - memcpy(qhbuf,(*he->h_addr_list),4); - return(qhbuf); -} - -/* Dump raw form of IP address/port by fancy output to user - */ -static void dumpraddr(unsigned char *a) -{ -short port; - printf("[%u.%u.%u.%u]",a[0],a[1],a[2],a[3]); - port=(signed short)ntohs(*(unsigned short *)(a+4)); - if (port) printf(":%+d",port); -} - -/* Like dumpraddr() but for structure "sockaddr_in" - */ - -static void dumpaddr(struct sockaddr_in *sin) -{ -unsigned short ports; - - memcpy(qhbuf+0,&sin->sin_addr,4); - ports=htons(((short)ntohs(sin->sin_port))-UDP_BASEPORT); - memcpy(qhbuf+4,&ports,2); - dumpraddr(qhbuf); -} - -/* Startup... Uninteresting parsing... - */ - -static int ipx_udp_GetMyAddress(void) { - -char buf[256]; -int i; -char *s,*s2,*ns; - - if (!have_empty_address()) - return 0; - - if (!((i=args_find("-udp")) && (s=Args[i+1]) && (*s=='=' || *s=='+' || *s=='@'))) s=NULL; - - if (gethostname(buf,sizeof(buf))) FAIL("Error getting my hostname"); - if (!(queryhost(buf))) FAIL("Querying my own hostname \"%s\"",buf); - - if (s) while (*s=='@') { - portshift(++s); - while (isdigit(*s)) s++; - } - - memset(ipx_MyAddress+0,0,4); - memcpy(ipx_MyAddress+4,qhbuf,6); - baseport+=(short)ntohs(*(unsigned short *)(qhbuf+4)); - - if (!s || (s && !*s)) addiflist(); - else { - if (*s=='+') addiflist(); - s++; - for (;;) { -struct sockaddr_in *sin; - while (isspace(*s)) s++; - if (!*s) break; - for (s2=s;*s2 && *s2!=',';s2++); - chk(ns=malloc(s2-s+1)); - memcpy(ns,s,s2-s); - ns[s2-s]='\0'; - if (!queryhost(ns)) msg("Ignored broadcast-destination \"%s\" as being invalid",ns); - free(ns); - chkbroadsize(); - sin=broads+(broadnum++); - sin->sin_family=AF_INET; - memcpy(&sin->sin_addr,qhbuf+0,4); - sin->sin_port=htons(((short)ntohs(*(unsigned short *)(qhbuf+4)))+UDP_BASEPORT); - s=s2+(*s2==','); - } - } - - unifyiflist(); - - printf(MSGHDR "Using TCP/IP address "); - dumpraddr(ipx_MyAddress+4); - putchar('\n'); - if (broadnum) { - printf(MSGHDR "Using %u broadcast-dest%s:",broadnum,(broadnum==1?"":"s")); - for (i=0;ifd = socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP)) < 0) { - sk->fd = -1; - FAIL("socket() creation failed on port %d: %m",port); - } - if (setsockopt(sk->fd,SOL_SOCKET,SO_BROADCAST,&val_one,sizeof(val_one))) { - if (close(sk->fd)) msg("close() failed during error recovery: %m"); - sk->fd=-1; - FAIL("setsockopt(SO_BROADCAST) failed: %m"); - } - sin.sin_family=AF_INET; - sin.sin_addr.s_addr=htonl(INADDR_ANY); - sin.sin_port=htons(baseport); - if (bind(sk->fd,(struct sockaddr *)&sin,sizeof(sin))) { - if (close(sk->fd)) msg("close() failed during error recovery: %m"); - sk->fd=-1; - FAIL("bind() to UDP port %d failed: %m",baseport); - } - - open_sockets++; - sk->socket = port; - return 0; -} - -/* The same comment as in previous "ipx_udp_OpenSocket"... - */ - -static void ipx_udp_CloseSocket(ipx_socket_t *mysock) { - if (!open_sockets) { - msg("close w/o open"); - return; - } - msg("CloseSocket on D1X socket port %d",mysock->socket); - if (close(mysock->fd)) - msg("close() failed on CloseSocket D1X socket port %d: %m",mysock->socket); - mysock->fd=-1; - if (--open_sockets) { - msg("(closesocket) %d sockets left", open_sockets); - return; - } -} - -/* Here we'll send the packet to our host. If it is unicast packet, send - * it to IP address/port as retrieved from IPX address. Otherwise (broadcast) - * we'll repeat the same data to each host in our broadcasting list. - */ - -static int ipx_udp_SendPacket(ipx_socket_t *mysock, IPXPacket_t *IPXHeader, - u_char *data, int dataLen) { - struct sockaddr_in toaddr,*dest; - int i=dataLen; - int bcast; - char *buf; - -#ifdef UDPDEBUG - msg("SendPacket enter, dataLen=%d",dataLen); -#endif - if (dataLen<0 || dataLen>MAX_PACKETSIZE) return -1; - chk(buf=alloca(8+dataLen)); - if (compatibility) memcpy(buf+0,D1Xudp,6),buf+=6; - else memcpy(buf+0,D1Xid ,2),buf+=2; - memcpy(buf+0,IPXHeader->Destination.Socket,2); - memcpy(buf+2,data,dataLen); - - toaddr.sin_family=AF_INET; - memcpy(&toaddr.sin_addr,IPXHeader->Destination.Node+0,4); - toaddr.sin_port=htons(((short)ntohs(*(unsigned short *)(IPXHeader->Destination.Node+4)))+UDP_BASEPORT); - - for (bcast=(toaddr.sin_addr.s_addr==htonl(INADDR_BROADCAST)?0:-1);bcast=0) dest=broads+bcast; - else dest=&toaddr; - -#ifdef UDPDEBUG - printf(MSGHDR "sendto((%d),Node=[4] %02X %02X,Socket=%02X %02X,s_port=%u,", - dataLen, - IPXHeader->Destination.Node [4],IPXHeader->Destination.Node [5], - IPXHeader->Destination.Socket[0],IPXHeader->Destination.Socket[1], - ntohs(dest->sin_port)); - dumpaddr(dest); - puts(")."); -#endif - i=sendto(mysock->fd,buf-(compatibility?6:2),(compatibility?8:4)+dataLen, - 0,(struct sockaddr *)dest,sizeof(*dest)); - if (bcast==-1) return (i<8?-1:i-8); - } - return(dataLen); -} - -/* Here we will receive new packet to the given buffer. Both formats of packets - * are supported, we fallback to old format when first obsolete packet is seen. - * If the (valid) packet is received from unknown host, we will add it to our - * broadcasting list. FIXME: For now such autoconfigured hosts are NEVER removed. - */ - -static int ipx_udp_ReceivePacket(ipx_socket_t *s, char *outbuf, int outbufsize, - struct ipx_recv_data *rd) { - int size; - struct sockaddr_in fromaddr; - int fromaddrsize=sizeof(fromaddr); - unsigned short ports; - size_t offs; - int i; - - if ((size=recvfrom(s->fd,outbuf,outbufsize,0,(struct sockaddr *)&fromaddr,&fromaddrsize))<0) - return -1; -#ifdef UDPDEBUG - printf(MSGHDR "recvfrom((%d-8=%d),",size,size-8); - dumpaddr(&fromaddr); - puts(")."); -#endif - if (fromaddr.sin_family!=AF_INET) return -1; - if (size<4) return -1; - if (memcmp(outbuf+0,D1Xid,2)) { - if (size<8 || memcmp(outbuf+0,D1Xudp,6)) return -1; - if (!compatibility) { - compatibility=1; - fputs(MSGHDR "Received obsolete packet from ",stdout); - dumpaddr(&fromaddr); - puts(", upgrade that machine.\n" MSGHDR "Turning on compatibility mode..."); - } - offs=6; - } - else offs=2; - - /* Lace: (dst_socket & src_socket) should be network-byte-order by comment in include/ipx_drv.h */ - /* This behaviour presented here is broken. It is not used anywhere, so why bother? */ - rd->src_socket = ntohs(*(unsigned short *)(outbuf+offs)); - if (rd->src_socket != s->socket) { -#ifdef UDPDEBUG - msg(" - pkt was dropped (dst=%d,my=%d)",rd->src_socket,s->socket); -#endif - return -1; - } - rd->dst_socket = s->socket; - - for (i=0;i=masksnum) { - if (addreq(fromaddr,broads[i])) break; - } - else { - if (fromaddr.sin_port==broads[i].sin_port - &&( fromaddr.sin_addr.s_addr & broadmasks[i].sin_addr.s_addr) - ==(broads[i].sin_addr.s_addr & broadmasks[i].sin_addr.s_addr)) break; - } - } - if (i>=broadnum) { - chkbroadsize(); - broads[broadnum++]=fromaddr; - fputs(MSGHDR "Adding host ",stdout); - dumpaddr(&fromaddr); - puts(" to broadcasting address list"); - } - - memmove(outbuf,outbuf+offs+2,size-(offs+2)); - size-=offs+2; - - memcpy(rd->src_node+0,&fromaddr.sin_addr,4); - ports=htons(ntohs(fromaddr.sin_port)-UDP_BASEPORT); - memcpy(rd->src_node+4,&ports,2); - memset(rd->src_network, 0, 4); - rd->pkt_type = 0; -#ifdef UDPDEBUG - printf(MSGHDR "ReceivePacket: size=%d,from=",size); - dumpraddr(rd->src_node); - putchar('\n'); -#endif - - return size; -} - -struct ipx_driver ipx_udp = { - ipx_udp_GetMyAddress, - ipx_udp_OpenSocket, - ipx_udp_CloseSocket, - ipx_udp_SendPacket, - ipx_udp_ReceivePacket, - ipx_general_PacketReady -}; -#endif // NETWORK -#endif // __ENV_LINUX__ diff --git a/arch/linux/linuxnet.c b/arch/linux/linuxnet.c deleted file mode 100644 index e96f724b..00000000 --- a/arch/linux/linuxnet.c +++ /dev/null @@ -1,368 +0,0 @@ -/* -THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -*/ -#include - -#ifdef __ENV_LINUX__ -#ifdef NETWORK -#include -#include -#include -#include -#include -#include /* for htons & co. */ - -#include "pstypes.h" -#include "config.h" -#include "args.h" - -#include "ipx_drv.h" -#include "ipx_bsd.h" -#include "ipx_kali.h" -#include "ipx_udp.h" -//added 05/17/99 Matt Mueller - needed to redefine FD_* so that no asm is used -//#include "checker.h" -//end addition -MM -#define MAX_IPX_DATA 576 - -int ipx_fd; -ipx_socket_t ipx_socket_data; -ubyte ipx_installed=0; -ushort ipx_socket = 0; -uint ipx_network = 0; -ubyte ipx_MyAddress[10]; -int ipx_packetnum = 0; /* Sequence number */ -//int ipx_packettotal=0,ipx_lastspeed=0; - -/* User defined routing stuff */ -typedef struct user_address { - ubyte network[4]; - ubyte node[6]; - ubyte address[6]; -} user_address; -#define MAX_USERS 64 -int Ipx_num_users = 0; -user_address Ipx_users[MAX_USERS]; - -#define MAX_NETWORKS 64 -int Ipx_num_networks = 0; -uint Ipx_networks[MAX_NETWORKS]; - -void ipx_close(void); - -int ipx_general_PacketReady(ipx_socket_t *s) { - fd_set set; - struct timeval tv; - - FD_ZERO(&set); - FD_SET(s->fd, &set); - tv.tv_sec = tv.tv_usec = 0; - if (select(s->fd + 1, &set, NULL, NULL, &tv) > 0) - return 1; - else - return 0; -} - -struct ipx_driver *driver = &ipx_bsd; - -ubyte * ipx_get_my_server_address() -{ - return (ubyte *)&ipx_network; -} - -ubyte * ipx_get_my_local_address() -{ - return (ubyte *)(ipx_MyAddress + 4); -} - -//--------------------------------------------------------------- -// Initializes all IPX internals. -// If socket_number==0, then opens next available socket. -// Returns: 0 if successful. -// -1 if socket already open. -// -2 if socket table full. -// -3 if IPX not installed. -// -4 if couldn't allocate low dos memory -// -5 if error with getting internetwork address -int ipx_init( int socket_number, int show_address ) -{ - int i; - -/* DPH: killed kali for now - if (args_find("-kali")) { - printf("Using Kali for network games\n"); - driver = &ipx_kali; -//added on 12/20/98 by Jan Kratochvil for direct TCP/IP games - } else*/ if (args_find("-udp")) { - printf("Using native TCP/IP (UDP) for network games\n"); - driver = &ipx_udp; -//end this section addition - JK - } else { - printf("Using real IPX for network games\n"); - driver = &ipx_bsd; - } - if ((i = args_find("-ipxnetwork")) && Args[i + 1]) { - unsigned long n = strtol(Args[i + 1], NULL, 16); - ipx_MyAddress[0] = n >> 24; ipx_MyAddress[1] = (n >> 16) & 255; - ipx_MyAddress[2] = (n >> 8) & 255; ipx_MyAddress[3] = n & 255; - printf("IPX: Using network %08x\n", (unsigned int)n); - } - if (driver->OpenSocket(&ipx_socket_data, socket_number)) { - return -3; - } - driver->GetMyAddress(); - memcpy(&ipx_network, ipx_MyAddress, 4); - Ipx_num_networks = 0; - memcpy( &Ipx_networks[Ipx_num_networks++], &ipx_network, 4 ); - ipx_installed = 1; - atexit(ipx_close); - return 0; -} - -void ipx_close() -{ - if (ipx_installed) - driver->CloseSocket(&ipx_socket_data); - ipx_installed = 0; -} - -int ipx_get_packet_data( ubyte * data ) -{ - struct ipx_recv_data rd; - char buf[MAX_IPX_DATA]; -//killed 6-15-99 to get rid of compile warnings - OE -// uint best_id = 0; -// uint pkt_num; -//end kill - OE - int size; - int best_size = 0; -//edited 04/12/99 Matt Mueller - duh, we don't want to throw all that data away! - //--killed-- Like the original, only take latest packet, throw away rest - //do _NOT_ throw them away! - while (driver->PacketReady(&ipx_socket_data)) { - if ((size = - driver->ReceivePacket(&ipx_socket_data, buf, - sizeof(buf), &rd)) > 4) { - if (!memcmp(rd.src_network, ipx_MyAddress, 10)) - continue; /* don't get own pkts */ -//--killed-- pkt_num = *(uint *)buf; -//--killed-- if (pkt_num >= best_id) { - memcpy(data, buf + 4, size - 4); - return size-4; -//--killed-- best_id = pkt_num; -//--killed-- best_size = size - 4; -//--killed-- } -//end edit -MM - } - } - return best_size; -} - -void ipx_send_packet_data( ubyte * data, int datasize, ubyte *network, ubyte *address, ubyte *immediate_address ) -{ - u_char buf[MAX_IPX_DATA]; - IPXPacket_t ipx_header; - - memcpy(ipx_header.Destination.Network, network, 4); - memcpy(ipx_header.Destination.Node, immediate_address, 6); - *(u_short *)ipx_header.Destination.Socket = htons(ipx_socket_data.socket); - ipx_header.PacketType = 4; /* Packet Exchange */ - *(uint *)buf = ipx_packetnum++; - //ipx_packettotal+=datasize+4; - //if (f2i(Players[Player_num].time_level) && (f2i(Players[Player_num].time_level)%10!=ipx_lastspeed)) - //{ - // ipx_lastspeed=f2i(Players[Player_num].time_level)%10; - // printf("tot=%i,t2=%i,time=%i,avg=%i,a2=%i\n",ipx_packetnum,ipx_packettotal,(int)f2i(Players[Player_num].time_level), - // ipx_packetnum/(int)f2i(Players[Player_num].time_level), - // ipx_packettotal/(int)f2i(Players[Player_num].time_level)); - //} - memcpy(buf + 4, data, datasize); - driver->SendPacket(&ipx_socket_data, &ipx_header, buf, datasize + 4); -} - -void ipx_get_local_target( ubyte * server, ubyte * node, ubyte * local_target ) -{ - // let's hope Linux knows how to route it - memcpy( local_target, node, 6 ); -} - -void ipx_send_broadcast_packet_data( ubyte * data, int datasize ) -{ - int i, j; - ubyte broadcast[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; - ubyte local_address[6]; - - // Set to all networks besides mine - for (i=0; iCloseSocket(&ipx_socket_data); - if (driver->OpenSocket(&ipx_socket_data, socket_number)) { - return -3; - } - return 0; -} - -void ipx_read_user_file(char * filename) -{ - FILE * fp; - user_address tmp; - char temp_line[132], *p1; - int n, ln=0, x; - - if (!filename) return; - - Ipx_num_users = 0; - - fp = fopen( filename, "rt" ); - if ( !fp ) return; - - printf( "Broadcast Users:\n" ); - - while (fgets(temp_line, 132, fp)) { - ln++; - p1 = strchr(temp_line,'\n'); if (p1) *p1 = '\0'; - p1 = strchr(temp_line,';'); if (p1) *p1 = '\0'; -#if 1 // adb: replaced sscanf(..., "%2x...", (char *)...) with better, but longer code - if (strlen(temp_line) >= 21 && temp_line[8] == '/') { - for (n = 0; n < 4; n++) { - if (sscanf(temp_line + n * 2, "%2x", &x) != 1) - break; - tmp.network[n] = x; - } - if (n != 4) - continue; - for (n = 0; n < 6; n++) { - if (sscanf(temp_line + 9 + n * 2, "%2x", &x) != 1) - break; - tmp.node[n] = x; - } - if (n != 6) - continue; - } else - continue; -#else - n = sscanf( temp_line, "%2x%2x%2x%2x/%2x%2x%2x%2x%2x%2x", &tmp.network[0], &tmp.network[1], &tmp.network[2], &tmp.network[3], &tmp.node[0], &tmp.node[1], &tmp.node[2],&tmp.node[3], &tmp.node[4], &tmp.node[5] ); - if ( n != 10 ) continue; -#endif - if ( Ipx_num_users < MAX_USERS ) { - ubyte * ipx_real_buffer = (ubyte *)&tmp; - ipx_get_local_target( tmp.network, tmp.node, tmp.address ); - Ipx_users[Ipx_num_users++] = tmp; - printf( "%02X%02X%02X%02X/", ipx_real_buffer[0],ipx_real_buffer[1],ipx_real_buffer[2],ipx_real_buffer[3] ); - printf( "%02X%02X%02X%02X%02X%02X\n", ipx_real_buffer[4],ipx_real_buffer[5],ipx_real_buffer[6],ipx_real_buffer[7],ipx_real_buffer[8],ipx_real_buffer[9] ); - } else { - printf( "Too many addresses in %s! (Limit of %d)\n", filename, MAX_USERS ); - fclose(fp); - return; - } - } - fclose(fp); -} - - -void ipx_read_network_file(char * filename) -{ - FILE * fp; - user_address tmp; - char temp_line[132], *p1; - int i, n, ln=0, x; - - if (!filename) return; - - fp = fopen( filename, "rt" ); - if ( !fp ) return; - - printf( "Using Networks:\n" ); - for (i=0; i= 8) { - for (n = 0; n < 4; n++) { - if (sscanf(temp_line + n * 2, "%2x", &x) != 1) - break; - tmp.network[n] = x; - } - if (n != 4) - continue; - } else - continue; -#else - n = sscanf( temp_line, "%2x%2x%2x%2x", &tmp.network[0], &tmp.network[1], &tmp.network[2], &tmp.network[3] ); - if ( n != 4 ) continue; -#endif - if ( Ipx_num_networks < MAX_NETWORKS ) { - int j; - for (j=0; j= Ipx_num_networks ) { - memcpy( &Ipx_networks[Ipx_num_networks++], tmp.network, 4 ); - printf(" %02x%02x%02x%02x\n", tmp.network[0], tmp.network[1], tmp.network[2], tmp.network[3] ); - } - } else { - printf( "Too many networks in %s! (Limit of %d)\n", filename, MAX_NETWORKS ); - fclose(fp); - return; - } - } - fclose(fp); -} -#endif //NETWORK -#endif // __ENV_LINUX__ diff --git a/arch/linux/stHqFIq1 b/arch/linux/stHqFIq1 deleted file mode 100644 index dfc33ca765774cb1139886d6312cf0c42bfef22f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 86016 zcmeFa3t(MEoj*P|4W*V!TLA$D2~eP|rOmr(0+`3WO(SU%@@NYPmo&L)Qt~4A-cp3h zg@O=b5!}VMYr!X|D~LQq)F3Psaed$m6?ZGky3uy`SFwu~S@QpUzTcU1=H8^xqW^vN zv^VE-zVn@#@63GXapug-_vEuWN4k2?nZ2wa`&v=DqGWkRS$Pr2h2rG@Ehwlcsjwa{ znQe?&Xv~b8!e1e1)BQe>XAFP)%1z{bKl%UtmshgU*dJ3F?;Gq(#gnPdk(3FZP1n$1 zJk>jrNcIl(cbmT9&GG)e!Sv>MeIm8`ikj|jxFkJt^KfFYZK&(gM9L%9^$#TzQ>bl; z!S0sM9M;xESE6rI!qTTkzCPJKjY#S4VTrD95aRduCsfd6D92zTb@|Z9rNT5UaSo;j zOaoGbdpw;?j3k36%d4r{kQhviboR$ppw>iZ_Z6ml1QL!&SQ`?l_`nr$_y;B4>1Bs? z=^yHXZ{Hz1*O=!Lk_sE|?o4&6Br35=(Zvi5BGd#ZD+?rvjEv_J8NWu30>y(yLeBLg zL!I4Soyk;|ALfPTLl9)&U@9?Ub0dqF99_MggBud@?nF;#x*uv2=Jg0NNrH;^^!2OM zLUJJm)Shm$5*#c02D?}GjU-dSQ&VDd_#nz-3^Qu!P*@M829}nVm!qB)6&9lU1%Jy+ zOYu}xQc^5+@RHeA#~N2gA`w(Xy&`6Y37?D^KSSxIa$9JQG)I_@(SLs8(QTV}-@1F& z#7mQtlUpC#+e;4nFz@>D^od&^dug)ls@ECQI|nWsBjV;5=wV*Ahr>dKCmx-}&~QxMHUwM?(;nB@w_pgvfU-IEfzd!V-96_o6uPz#%vN?CiriGoy!x&eA_+29SWWjZUPZ7LM@Tr0a1)nDP-GZqh#(Y#THOZKJ1s4l`QgDgj zX9cUa|4FdQeAGjb|^a8z)S;F#cg!7ByF1=kDSBzTqJ_X=(h{7J!0f}az7p5T`Rw+cQ1 z6)a=g1eXYI7ksYZHG;bYpD*}I!9#){7d#^P8Nq46F9^O;@LaSD8FQ83#e%OE921-o zyk78D!CM4hC-}pHZxH+?!5Bc`dQ$Kdit|U0Nnsbtx)X zb!n~O1>*No!KVqnTJY(DZxeim;JXAb7W@stO9lT>ue1d?>&MS3BFfwEwGbworme@WcG2=>AN652D=!N34O|Z5(B)D)s;f3SV$A$mf;`eF6PYQls@OK3J{B!1pGTiUsW$1KW zUd24@`}Oe^;K`T^^IQZ@&QE%Nzv5xv@4tHVljk#>1{X|_-g==I3Vj2xlkF-G-{#>b zg#WmR3&_dy4?@>E`v<`bgk|0v7_ZjZ#e%iY($V>ig6`t=>6?ZBlM>GR1Pe5KJe)j+ z;qMWLF~Nt6YUj}!ca;Hi1?OVFJRF9?sYn-Nrlj5$Fc@Ym(xji5VzIy(A?_d|bZKlC4X^xt`S zCd75&p9q{WnwCPr5D?c&!2-<{f=|>3{B`n>;P5t&|Bc5pOx43O!RqzPf-B_V2Od3v zF{ta8{V=Zs-O1_GKMeW;bF>DEztJqL^3!nvei(L`F9|;)v{%&l_|1-ta8AOAT(77p zz>~u#8y&?ku2am4fPO|WK91t$yCtBXX*w*X4DZ12G00G0-fF2j#_r~myl`}xWxYcK ziDlixz010bH_MOj#>?a-c$s6`(A8BO?;08y#_LS?QczQssfC40iWZ$cBDbo-!eYFm z*b7fZ%Y&=R;8kiw_=}alcu`ehRZ;QsD$_qSxS_y>R&rpWr3aIJ8wL~IfxlAEpA!Lh zNKq09;o_R&x$Gc3XGvQgdgP1Q)T^p6jNL;v(Gu1aX_kk9`TA{1b< z0`K4bm7GgpF0$qmMdnWIFB^BiWnB7`dymUp`(qcb$goap>eeX=f zS!(61+>p9-k-40uY>6mI5K9)B?!HYzDi*%tC2&YqT$Ub6`Nc4j7|1Dw{?H#veqk}f z_xzPC(&DrJ@aRe}JFk%X)D^>1vt@l>D#zs@lOK<#Iq}2Rs={VKQPCnpveY4=YaXC9 zN!G@z0$E~ni$p4iup)KHt}JP|FAhSf$=W+=3h*W4=JiehXpfYim+BZ04!!KsaDyXXQ z_`p!NDsaV;VkXQo4?^uPb?i)+r4RM=II5;fBJB6bOp}#)IFO@Q3sCYt8Ppj>sYNLC zk^a5`7q%u*1SC1gv0_c7q&*DWOJq+nAeU$=OOUE$MLfQVEgn*V#B{n&xT>g%D#2P* zUWzs^jycq@7)msSB3zeG*Cdu8O^e~ZnAw=>8*tfJqG^(hNnXCb-(_QoDyGmef7=z% zRWXI$(;Xk^OkOHFU!saBX$3u*(5g^s3y;Y{2NRF?bSLAi$V^>nR_aQSJfwI9(^phj ztSP)SafQw0QZIdd!(H*PxJp$qMfH(@uECV^qU9*EszXpTrA)Rh_?~38FRwVAQ|Qkt z(w-#dg1y+ZU_}j_Q{b;m^FdW%a44j!7KoE*1yOPh%S1w$i9eo-U^_Rh{Lg zd12#84X0c!EemuyXako^8_1T>gbm)V}=`kj-m2~+M&0D6~)&AvZ&_o(Ax;6!3Yi6QpF|P3d zQFD_0aL`JCYEy$WhK&Ts%t9oRskBuPL`@RfCKJlU5ePYe>hD}Z3b%8I;w`GkE9 zsM^XP9ioKVS%R#M42oLmw)caAGT)^46MoytfzAw(VUEyk^#Wbf2L&2QZ0JkkLy$S)z6x-HF6O!$s zwX+lj>6%*s>Ot%NvY*@^tZ|F|cnj-3+<3A`}&s zBUxO!nX#irge6(bf|Q=Jw4$n0otKoNIj*RZVuBNdDk`tSSMRv>jusLF@`@_X3}j1F zm0cG21dY$WPHzvg4T;M{0{W^Re0WD2Q7kPu-Xl;$7vqV|bPt4w4reJJ-jMo+USpgG z*Vf^CveYiTOm$(Lg#`gg5wt`!wzz~U%8?R#l9dgOF(#r&-HPb8IT>$gj*Cln5|C42 z65N|#ydD`c*we>24^B>fWxE{BqGqJ4{b+0vXxOqAmx*wN&=Bijn?E?Pwn<*Y2ODkM zV8SJ6%dJc3Cuq_SPF$O<$eLiZSgehJW+gLipmXHX#0V>)Gz4g>;)D2D4*f;F68#`u z-xA}=_30jQfk4n4=Dn?v@!=tiADJ#&Au$$qMS`%Ul#)fLM?L+W8yu(9JF>~we5vH9 zplA%W@d{i}HD%-t7p?7q%lghFYP@>VDo>}&NBUBUxbJ3be(2~$X6t|G=0#_l0lFdS zSwR*vgNm!1ljo_pOd21$Bs(`{3sPJmO_2D)s*&_?R+uHlL6(S5FVK=QX^?DrAqS;= zmXuVe6nKa38?;5Uq?FwbMB}=M!692LrD%&tL}ShOCr7Q&7}+RcgvECR9a=3ZL(@e5 zuJj11OMiL*!Ak>IRtg;|uZnLXvTO5X5RA%4B%9o=>LQ{tSDbHHPVOa8(WRF?sG~UYoaPuLR;-If=a96 zLLaocYg>h|A@gF51EnLHju}YC&5i`_6kkNJq7I}SHhF%glc5*{N@gjjsdC{kVgvnGNrV#K7*VmO` zh|*^zi^`S4Wo+xwF=(4E<%9)k$-W_J1`wTwjym2GaB1Vr^>6FbsT5RzzO|?-sz~nK zoN%OtNVrXIph1Cj61~VKc}OWj*)+A9hcc2av;$PB8z`8Hs(!AH%c8RR=FGt%mr-W+X-Pg~{bFBdzcKZ7b(IAR>zg_j73d6jfqb?qDk?8n z7)`9l8(aY#mo;*Zd=b`BZ>Z{iez2m()Cy?x^!?Tm7o`T zB!eRUg=dh4lowwT2A~kZhq(g){9?$D&ND49zYWT_Jo}t)?>?^^KnOvC5LN#{M#trifm3`M^CG9B~qV_N-mRHNLk0nJ?uXS&O$ z=bPV6`aIbyK^eXu1D{!&vXmSR(uO2PwS(QJ9jyVFIdG8G+rvPq9yZC!iMp@Z`A+TJ+M37NjosoxiK~Q-Ufg|f6=@q0SQCww`2L)VZ>C6-IpU*p%i(Jh6 zQJTgG6utn@yg!DuY7x}6y}YBITn9`#*F0m`5G+A{we`ovd`_6~_m$UU~92 zU%(^QF!$_;?a4Q{({VJm7f;U{!?5OUi|uJ?)4(2QU@uRmXEU&BaPB%|N9-AD2ROII zo@v<@+i7{hdHwj7#bnID-HR0qo;5g$epk`9FUz8vvDkB;0HY~->g&91TRm}8{_Gp0 zZ_KaV`r={l`hDQ5Xnb4ZTNhp&uDd>K?V7f+EpzshZV`1H0q$A?Q6m5dX=6Tx-8ge& zBurQV6NaVQ$R%)j@@g)94L-B82&@}tZj0?}k-R~ANB8wS@~v4tqp{~H%XIm6gyb87 z-?ikH>nGElJ7P}}BSYWX47_nLc_lJr6=n4r>HY zJbH`BQ-C5&&lh_@f^FnulNT@bT!jT$pEjc!P(p1iseF$=e+k-{{dl=HdH1?DKzjKXjkx zUp$^S=To-3Y;0k?%RqPXbO}$x6rLMAp4&a_$Ms|JTOfXS3qD!!4D<&XbBf^O1fME+ zso>KDuM{lJlzE3>_9Vt61s4k*6Rhi4?+~ml^;ZQ;qicRBm?J!6b_-@tgnkqQv5Z}r zcA{WiJAbxd_EN^Q3D&jJeS+U6^s5C|3%*Tojo{A4;5xxS7aSG*JHau*hhxy0 zF)Ib1B)DF1xnTB?#xx7o{O=arBy?Rzf1conh2ARo8NqFWe=oRQ@DUieWXu}DrwV3| zYfP2kA;Iq!JR{cgc`3f>|3F2TC4{Bwf;UFd%+_{cXUwZWU$An?7^6*t2exHZ$@$mON?1#TUyz3zO_ZQA=EdS0Jt-rbtfSks> z2XvP|cM8vm>VUs44<8k}l8?g+V8(L1-^0n{Li#yaM(%jN>ETHaufoKJi+8<;8MKSn z$6LVT!u081@#u3g0p)nk60C3DbKXKa-{$pl;V&u(Wq6y1$>n&G`=Q_L(eLu`xQ7ic z7tVp;y`JAA(FAAc3D@6yxb_s%b=2G=Sb0uB(Pm7uJVXU6{fmOv$isI%Itfm;fdyec z+~8rK=c^w52Ojo$4nsF^EeZB=;hzF}#uN*6gIJt7Jt6pf!Pf}Ze&l0Wmoh5k;#qk`WjcuX+=xV-wD(3RZ1h~ewi^41Vv z?%`9Hg!DT-eEOLo{hh$q+Hh|5=+Aoit>}_nT<`HPy*b%-f$qZb>9dxFetmiy=#Ib7 z!#>Xq`=Ni;qdyItp(kA5Mz@g>WXy3G$~#PwlN0OkgLr-VN{{|d@wh=-r?uZjkc`mLadIF_xPFdKGX6 zDc^(n%T$hA{^SAPbdMfyY2c@X|1b{8&r9yJ$&{t?JfZMEtyi}OH#7&v3@l`^9DasIK_PTc92 z7t>Ds1o#)2$4N31z}wB=N!p*cm}!sHDIKrAW}e{3gYTeG>zDqc=G*udqE{5}Sz&s= zYfq^l&-YAK!1H~3vHbSDa&AgSQn_*JsMQ)kAwkq@5C3u8BD>RMOs$O!hrzy+d(dtvYlffg?mde&YT zP#_R@QDL34E;@ddtuPw$p`9>)xt%alI=MSxq+tGA?Sz3uuf7uoOnCbcO*`J1B;&xu#UTGr?o!J2Jj%u=>jWBd&E#@6nWIr2W=*o>Syd&XLHo{0l za3K3&-1cxe;6%4DWp4${+8dKKK;=ePH$DwUns#Sz&Q^R-*=9i?yWJV@i`;A_G&G07 zW_%FYP-XAN2a##b-Hs13k`A)JA0I?+!^Tb)Y{LmQNw(=iV;t_vCtcI#Z_6iD6UTk|ZVNuCnmTU}K8c#P>`nNjYx20K zCESHix+W02zP)Yuq}%QJNVwaF52`zf1l(C=>TR5sfwOL#W_BXJgX=l;CB$vSXPnym zp|paX_@pueb-%mLBap_-lgkAr-hO=2nSWphzc_f|>sEafyuTwKUhGzVOGTVpk=D~p!MQ?$Mn55@Y>TC=vY#KP$6%2I`G zvGZDL>duX|SC%QkKA|_yIlv$&eIA2^a!Gc^dpZaD`t>NG5+@*3km8XE+v&KElNGf* z;Kq(PvSJ919mt?^V;6P;vzztmZ&8WeWDMoT2@BX|=mN!-k)e^!4czYtPtbd91(MiR zBGP1qkG3Nj@9f6`ecYRh4$=+qNgsxcvTGILpn(n>kD{U#Hg;^=TTxz!*b6i|G}wvN zZT0cy=33-2QA;d#E^?SK+T7IM+T76|L*DYauD!LRsjjj@`C6OTonML6&_x~auHn3` zt!ZelL}Yx9HMdrB_aZUrHI0px+>g%Zl?_dm+|^Coc79VOPjr%pj@J6h;zH~Xr%P*F zdu3@M_89UZ*4lbrN30`OS;3v~q%<|RHPkoNG(sBgJ+CqY$ql`(w9xh77!Oe5y2%&& zP~GlKOM^;Ec?BCt$=o-Djh7G_{S)4#kkuHtY{pj8O*r7hZvC}v;vI$Rw*QihJ&CCi z>`3OW*F`8MC{1yd=Meg_JN@bAA43qF_0a{FAT1mxK|4r`he60jSWDZKa7Q58-KJ!f zY9-yZl^myUkRE6%2U?-FoT&$hX@Wdm;jk;wR<}Cd+EBl$y^VDe4|T1vXsoHdp{B77 zY7>tOt+}ZwR@aW&S!L2)BMI&fW*(wOKzxkODmg;M&`jT3aki2YN}W36ye6eU2;IS( zQ+GR)1Ix70a1E+!<(x~O91w#BYJ(mnf#_McD*EF?gBY0mn~2%837h7T=3JE-ay69F zvw(A|y**kbtJY(z<7cJTdK4Sl23zf=;-Q0MUasnBkGDoE3zrC5i)x~%H40pe%tLmf z5v++uTjMpT5Gl&RP7^mICS8i=z&1_sIMh`J?V_&k03MH_Gi7;D=fNYR_RYz_KaT0N zvj}0BotulxtS7ApNQBgb&=)wS`orEh6^9BdaZ$s($h!NddP=|si}i)fQC~=_=L;ND zy3q3N;fUSyg?;c-G9~SDlEZkFFgs7u z)8u5RAv|?Ud~xXRMHOlY^|`LOsjYn)t(IXul#+w^Y4n<-NCeK#cZ%GBVsktx5>!mX z6bhG8Om1~+b1iHgh7L{w7B!p#v z*8ydNvZ!P^4ZQB7b&dOhjj(YBiM|+5Gsu^1xh^=@SJ?R%?$|BPb;~}B_sq;+80pAR8b=u+r@4oj zhi|kq8cju(Q1%cx41EG`BcaIRssj7Yq1f#CA>)1`O)*laq{c0RVTvL#($m>BRX8Xm z27#|2oIP@cfk89F{IUo5AO|2R#&MDo9Ma5lWZlVb(z`Qz7(S20!zmLoybuSTsUZ=2 z2`j>BLP5%=m0D7V7Kj3IS`8uV`C#tQH_*}YB#YtF)r0f@(y1XFzQ>aUIg}8u>9#mDV@V-N! zEPOY?D>p(;G_~aF4O3x*8C|AX*wQ&s7)-UDwRK#SwGP2PeE>RUvp@U9(Om zQgk*41&5Mn!8NzG$76M?nkywWe2O--)z#olQ{*F|?fka(n)XV3ySDt%n)BNmR>vxf zB!03q#oCoeA|z!c^F8p<9%}?kB_^tE5N%8#&WyB=46ZHKx+d0IiIb!(v8g5?mP%GI z+_kHk8`^Af@tNV21zy@2ZFwMh>)T_M%L7NuAJrp*<$-g1`}vIxP3Klt1T1YGEm0`f zia@Z~x>%hRj8jimvc~56hNgfVB&u$8G$4xZP{7#AHb=y`$Ocf`uyQ5U)(aB}b9`aG z%8Z&Lhu&K?v!Xf$X2a|NU*J#%Yao~tz)OXli{$Bv=zB{sBgn}~R&w`xM7DB|j{~5h za?;Wm6v{MXx~M#@EEPgR+m=1C_;=$>M#DiGSz!5QmN(S_-LP&v3k=&v94(5btK0TAHqa{NIZse zQ(uE*B-A$?9~#Ed`t1wLXCZ@4esm&I>$pihSLe%9Cs;2|guq|60BHN$yUW%BaQVT|&qL}BDeIL9_p z#(mj3;R+XIPpbVEYs1Y?X3-U?Xf6E5hOP?+Yb-R<#7#qxtdy>#9Sed_?%FO6;$Z+$Xnwc@g0cI zEv;Bw1y}Tde3Y+CkeP9!Pauhl+u9l~h}AZ5uA5WYHpT2^G0n{xS(jiu)vao1jLI`Y z@%B1?O5syeJ(~TNHkV>hnpZ*Vm#wZStEPhxPA_4W70upQd=9^&j(%=i*}%(>e0!F6S-TFIu%*+ zXjN--Q*%d~kPq$F+CW*GR_txhB{V>Q#twE+K!@=P;oA-q$9RE zj#0^Kt2rt^p5tq38ar$SvgOfGFQ3KKx28dgR|zV5ZC$*!rp@|Oxj~9HtX3u!8x)Kd z8!ea0O&Tg+lNC;-uWN2>jIWK!*B}W1Z{ZX=c3wxr8dLxjl9Dwov2`u27*%5Wml=ZL zA9< zKCa~GO(>dz;kB#7H$jr?wg_Xs|9s75w4uc^dqg!Afx zbDze`RZu^sxPB)u59Ey_J~SSv0_CCLLTe-~l%BNJmE|gYJF5E{DT;EHynPj#7&JHK zD!D$Q8Cn^Ouf&&O)>JrZQtD&v^{w$%v_%(a0b>ZyB!J$s)~7Gmq{;X@9u)C%O%;ao z9!=9@qm8mV=%{ONZjCn}gKISQ<(fXrb8hT>Rl()9LP!FTb66n|UyX0i%WX=PZqp}8 z#uOdJwE@+%w<9U^#*cA)0h!iO>hf~U0PAzQ))%iUo_A?w8k$zc&`4L}?DJeF+YI7+ zceYb=9a_V9o3wP56`D6qU?#b_wT+#{%E}7O51-!L)Yw#s@8pc9Wfd|=TA|7c&5D{e zK20;BraiWg7YoNJp~qn4nuuC9$Y+JOS60vJfs1+i9i!-Xm+Izn5)ifpHj zZXOvTa@mgEQW!A@HwdF`72mTdy6et`ARH=chZl+p+YzM3cI6!+zJ{XGc6i}hVH-J4 zQXUn!sWIM&&R$5i{{{)`IFzDU3rdqdTfJ^X+t{uYtI>@p^L3V_BCo4$D~mTYwqP=^ zdF4vHffivlf~n1RsBOUb2cQ1}m&O)Mx4}m_%G!3_;-j$ztaMNxzN$3F>TBw-{KfX; zs!?wIg&~r!=ZJmG7(3^@wQWeGUioo-@#}5V;RkGe5rghO3U(-5q<%M&|In;aFgZ|OW1R~ip{Xx>%OHNO_gZ@F(sY^~F z+k^f=1^(MM5O{QT&6Cui%Xav}p7~GJ;nfgj%ROMCeFbb69 ztVo?(d!!=ZjkTgmBWRZ|R!YWDt)eQLz=8XNo$?Wn(qKUjhDs~Sk+Ad#PT;q+BFvhC zD9O-}Tq-!{4S$$ZX5MoG1-7Q}={Cr7PM}mM-H9t%(u4Iq)JQu^!&m>nKj*6vC?~~n z!*cE%Wg5T&o`Zg&)x9>M9UqKRsC@i9nj1deadQntVC+KeIaosxP*0s-!gNe%8~~-L z$K|V`2!stiT)a@?2q$j>LlK};{lz&;)qDGgxonX+Hz-y zjzQ?5db0@lDHz<@1*OW1d7&ISgonOiDkJ;^>PfJrq8uoABY2pw7v( zVfDAFti%eP5uI(qUgVH46bc4O#V10i8mKUS zS&1}o9k@bbu_C!g3IGW`zh3d#gyi@{#C9R$i(Rd0o zl5GQX@rHp3g?XD(05(b4+Tya<<*=~^NQSw!1Iym=DAtW^UXOGuW1uuxUo5%Cq{C6- z#@>9Jn$4h169Rz=lVEcL9u36bzxJ6|fW% zG#y^xtD-vrCOaI@|9Z@=7Nmv>?DCU>!UGAx^UwG(vT@OKLh;o@$nh`ogJuI+I=#?d z5_0^*tdxr%T8?Eb1wBI}1?xwKI=j2@(RXTiIsPRNZ2loD>_qe{NRi`zn)HJsthrM{ z68}tfqPw8`3glT|mrKBDg{7OP@Ow!YsPUuW#A>Gkn&B$wP9(cV`i8Omya36!X*rD{ z{ZBTL@@Ax##~<;W8(!7;$vHH9z{T@;c%6*j>jdeavv6otH9X4MJs{=d$Mdsr44{O^ zqilFx;($I1A0f{~BENIqA743m4#&@3h~YbLq!Bi}20a7W z&?}hr{B-Pbd1D!m8je!ncd$F<`^Xw9z>IL$rk;_Zfn3WkEc-lE*af)LzRP0Xq4>*4 z$Khc0e4cA?5+9zCS(ot{d}Dl`Z*U5pK5yq8{ys%I{QWKO2>db9;r~f{f6mfpqpTV4 z3Al@089t)`-fo|1pNQdgkdE*+@)_Y=$!8o?_5t1@&z+=0o^SCP^8D03|B`q3f0lIk z-^DxRnF&20{~X@oJ|B0wS6X_trN=D2g?ISdL^|TXhtD`f@;Tnoj!|c5zox+6Z-h*= zZ*w&KL~xdMAs8ZPJFnyYSYtAfJ%Xb-w}VE1RF?J0?rgg^6)+rGP*A|*w!FXPrKJT0 z#ibR+xZ!$ryEjWNfKa$fW+qVJ#Pm!|!owjXmfo@#0`)IWOZQEk=VAiJv_Hwp; z%)B%?srHRfgl!x1#7@!J$0q(XISG3>ym-dyJg6tz3)+w2#W5H!U|PwKgqZ@i0kuSo%}@q5C|$Jf6ey!!TC>PiHe{wa^PBhHk+p3%*kDDS~eie5&A2 z3qDQo*9D(0_(y_^1n&}DELd&k=xM`mLO+zTt#gUsGT}K_Fh}dq5y2ILuM)gM@NI(i zWX}5ppDpw!1w+|z{YtQo&i){{TIjFG;5=h$1TPRwt%D8l|ruhs@M^)A3)ZrDk6@1cjJaKKx8VB( z_X_@w-~qw^BzREpi-NUW=Az-dR;V}&7I-=vEEOIPSzW&M3x7s@X9Qm(_%^{B>SqOi zR_I?Be5c?a3BF74Zv}r&Fo!`I8KL4`RPYytUMTo(!K(z{Blr@*_X@rO*rnyY9;Ty{ z*~fQzJdb(U=lMsE{vxom!E!9dr_J=jUEH zKK&2E|84O*_ejd{q~Jw@za!Y^uLIr5bCHLAo?AWo=RNH6?DXhIW327MJlDfldziL~ z9M6|M{FI0N@b`!R?I8L07tZT3_IEZ|P7_Q{W8MqwL3uua9r^{QC6AJo=mP{*s|1u6n`i1Rslc zqUmg~l;R!9$?$d$)030oUHhSb$fMuq;U_)phjSo!((`*fChRiwgzLv1e)|ce>xgVn zu<|TGu{j$oje?c_fMD&Xe&W&T>e85gOPCMu^{~(Ls7L>qhhKjZ9~7)(gC7a575W~*^@8UVP@Z!IFB04+xL)vT z!3n{wg0~9RzWd{X<3j(c;7bJmRPcJizZcvicpkdUjOiDArr-g=Zx=iyc!OZ=->(*Y zwa`B(cvSG+g2x2&&m9&$A#{DX7Ts{h(g)G?I((alYtRil`VJ3A(Iq?j2Z67(;e64f z!{kK3)8OH|JWOv+w%08R!|~~-gPtM5UXK4VkN*Y_lg;sbYCrU!dGr^6GdApr#UU=o z@YK=i?80mU{aVZK)4M(T2gUEEfXn&y`S14l|IWkz=;0SV?E5_sd{lWT=MvxyW&?TE z2|h;fTES?{aP%O=kT%N0gjdh)+BuzwzfEs;w#NYHPQ`3w#7eZd?*ZLQoC@Vwvrb$~wriy(T@ z*2;YW{+M|%z<=Y}WBE8NZ8-kz<`)6J-TXGdpD@1<@Tbg+0sgc(ETRul*wH;Ez@Ia3 z4)EvATLSzAvk>^($lGe<^WpIN6Tz)gzRv<@Oq-PBZo%zR)_)Y-AvRcMoJF2BQ*5xz z2fZ43;;wN3mxnt&OuCbwbRSbTUepcZ6ANVCn|1sI@<-_#V#&%a;sW zta_2>i@|pNxtscV0pxx9E9^tuibbw_%;=Vy^*s6o*nXS=wZlEZ8hmhi;*Sfm%tg= zexXeydKu>*d+o&iLW`Mp;@^UQ0c@vm-tTZkvfVr(X`gQ~(@uL_q+?ibmI?lL@U4}0 zSKJjv3xd}kxoB%edm-k@Q=Sc$A9^-ee&pF;`7yN5`TdD!gXIUoH#S;{+5nb1$WRS= zW&*Dk{B0@Ib-;YTqYai$p+9MuCj&zN&VKWRVe(?05Wf@r1-90W34SY`&F#Pokg9w% zeD?uwM=nUaWHIyV+rZc1P99#-AQy<=s6?S3@8LJe_gNC6(9{C!LOWm_?e0XF8T!Rc zE}h2t$6h;e*AcPG?{GKh%PE8VD03ioWBBprklh#@%6rIe%$eL!i*?*MdTua@gA%b^ z##-vY3MwoRla*A5?8dxCyD{Fm)LF~O|9smqZlRjp8%%!TJV|gOU*rY5(uDuO{VEqy*7oT%^s<2*`?(EhT z(Xy;t4(o`=Jt~&3f*Y%(#XgE2^`d8KLkz6?LwtzN(XogX+$tW(_Sh0#5G`l3D0@KX zVpez%xxsIbGC?w->y4lpqSt)Qv z`mm~06Nm$QoU5!3x0%%Ea!Ah7=CXQ(g<~EaudMb~YTuxqA&vrJ%6Q@-c!Pt%L1w~i z5aGe#vMx5DyR+9p)l^A@!J*|KGfh@zcV0NC_H-P^m<$vNbS*;3%fMa>$eKhEkmMl8 z6%16?~W_6Aq)>8w|UMJ?w}u%G0Dr<_v1(_)p#b#(y>gYE1;`l3V&#?1(GsZ zwlW0AMWfVg;W1fgl4;{58E55Y>UiW_m^vPAE#dG)2%G?mSK4^oov03GEkVirzTvKT zSX?}94pEEhBLU8W3cP4Jimd7o6iq3UZ4169neEFfPUjT*WAbg0_9U@@(u++CR@A^b z1^&u3A5;|vheEn)v3P>EhIH0W(N7jvJc*;1J6(k<^K>~CPiMPnUf6h2?nEF+9O!gl zNkFZopypziP0#?UwG_lmBC0=>p;)&bP)7nY0&2|wS-i*uO`wx|SYcD274r7HOVM%Si5Y|TvHegKG?lUe2icv_qKM;gOM0%T?( z63JBBDhQ(16xt4O4F`zKH*g~HPUAq-Bzg7(K+`0ldYiD#0NExA?P*wBLAI>`f(0a_Fo5&%)v4(VgJAbMd9 z20&U+wC4h!)ie|tsJ4RwSsNN;E~vH_0#%zC6c4CY`$5%42I&wT3_{j61|_ZZAZ%$o z_4qLAY!G@0b58ng-+ln}S<{EEY$UM(2WKR-YQZ6BWU_MlzlHUHB00++$wBhbFZFG} z5=CjO;lT9Z2I;kxmF@!sXmoZ1E9Wf+?Q2#dJ$2&wh1h?F100Znuf=)*Hkhi?W?2sa zRjcE{SPwv)-!oo8@RU-dMlgh z{)TEnsK+xMfHY)P-UBin08gk9+5~u}1HAA#pmnAL z(DP$Apzfs;dSE&L;h_G6EysRL2Y?OD_y1cc~EpiP!B6^;{%U@pRx;1Skbs zVkk;zML>d(1Q>woxmXcEU*is=79#?9#yMH4*J48e zgkT45&enQoC?FA>j^$<`oJ)=g0mhBG@mfs?sJW+X%OM=N^f=*wjYNA;esP($`>LIA#H$j>`6Wg5L!69TBjucX*&LI8nGb9%kAhQTOYoTy{U0u0RM72B>{HZ>tYE@Y(B&1tyAgaFxG7D5@PVY4O#z^En! z0HAzR8L=M*)+)&6svlHsDqEmhYC?daO_K&SA;7=_1$3>pmmz9GfLy4ul2V>WpPL`n zgaFxG89-T-EvJG1KVm|FnJztgwg~}m3>w&3wJwk5ji6Lqxz#WGImtgRsE^?FPFJ`I(Zh( z&4J8uqdSV;w<-W9Xg!?J9db4=%c=kzsfg2B6@VMGkRCmMb}kTZRGVq73cw9oLw}qQ zoF+z&G2v_zmSt4{emSOuD=J3lH;k17O}Juai2;X){L`amj7z3>#y=f3du&p?BmU`T z^Ct|`i%+wMQ=U^JwAtg5nG>UCkV{8Sl$t}nV;HB*HoG*sPX&;3daD9-&`e=l5?U1? zU30_=@2m>YAy5_`n_Gf+C%mrUSo1?x1#r@+%ZLB|Rs~RSDEUKH1^(|?6+nrjPKQ8+NW$0SuF6_J)?WLaPEFdDuB?P207aU3&DhTCCs;1vMK;xYGkfe0YBJms{-nxnUiHz03nIa z=2{iV35t_lVpYHo=m4z>APQ6i%hRe`Js0;>W_)f4P;UTS5Ow_mFQ@W`=Ewp9TT z<)vH)zW)QP3Y6+#frs$_AF(Qc6tkD*iL{5T3LLU3fODDc`NXRaSrvfgZ#k;@kX3<0 zRt0E1;E+{;n&`APT@G0lph=xWRt4gRtO`hn@qgB;07jE|U;59mDgYxnI+cp~$*dKH z&JI8pQQlpqb@>Zg6@ZbQKqPBb03@BgCFnjh7aGjJhK9zWWU%}VHLH^c;Gm2wJHD>L><2S;+vYV;DyyQDgZ7B6LMjVym0Nu zrU2ME$BY}&gR_41kaFLq0Gu!zlVwwYt1>xX5}FhcicWn@wJ6}E%r+<>)T#CaL?9%{ zwV!ntn^}u`~zxsLk-6J@Ao=XHNioCz)9GFi!v}&<1KzDlh>BD~Y z4o@zHtx51fX_OD@VEJ?=#5=rHIiU^8iEJ0nX^+ikn8Ix7*<8U|J((7?Fw*SZuzw)KFd#nCy^)r(?BQLx3b_6qiIC4!To z$XHnW0<+D~Did0X(2sWFEE01{-!6Fl1i*3Am$tk0Xb*<^UE)NhG+Ix+C=2|LlZj1 zvH+5XuYx(21=#$(M#BPO&WlW0X9YX4l2gqJh+@5>Spf*jzV2Y{3S`RzivkP>sheVG zfXZg#-9zz#VL5GCg+=BErWJYyQV?7vo!)+nwUU6AjGqdQ~I)94V%CX`?5oJ z3qrdMhwK*o7uqctN%Sve^*2k`Cvgf3>{uks(qyW0y;({pMf{5fAEY7W?HU>wNDQV# zn-A>Io56-7L*$$Y`l!ZF&P3n?E}mz>i|22=PLTe&5l4FM0en4v^q-F(&w1b}5PY^r zJDAM??))E+g^%|l{QU4XUxG7qL1TFI>%yx7X1FfATO0t57x{Qqnao>Yy zmO1MNZ6Cax zoYe(J|EgvdrdU+4W)cE(2sRNC;|5r`8R_hgdseox2OwrsQb!#^wvaX@pi8Jc3vj1x zfqLFSWF5~tD#vC5GWx@o?=HHdt@(=OAGi0PSvt#t;m$)DFx(~7aU5xLj(xs>cf@lk z>Bky#1Mi6ML)QI4J|n&z_L;U37~k{u`4rRxhFgj|=@;-B;oZh(D9pEbKi-%E)VI77 z(LVA176^rlwhO2?yt6&#o$Vy=)DzyRQxSA1a>sLlr9X$phVH{)(%r+^HWNxq%PU|NVLF=$B`eAf*k(e-7=*-CDu1W7nNT#I!Qn!< z((|P@R&U++x~peq&YEXZd$;bJJ@>E2Pn(466OW4Bfuq~TE}Df?XB#jTfOK%0WQ-r@m_@H z;#{(JP1}yxODt2G0FYEzQD53Pe`B6K9Dg)6vGuWn>&LeoN$D;D_is88%Plxke_QOO zmfng{njDyDajCq1JblDi?4`)~*73a2*h_$q>^y8Vws+BEqdT`CAK|o2940Az zsjc@7^xrYjYW*Xo^xQv~u3ooee!(_tnh3{vME-H~Gi5Ja{ZZdI64ksTs(P7B86$ z^vr1jt%h9N?ne-2;sgINIjQz1uEFCiqko*Sdf&G5=k;v8VqRXlX$(~c8CNrJG{1PP zE`KyyoIh4K3%6Ngb#ri=)3YO5oOk~qIL11j8_gq6t+3PzN9~-g-<&tv@!ZzO=S{|T zZ{1Na8QU`!+fx;LY3{YZWA=6I9zBLCHhRng=GFMN#J4WIIBs?S1l1jiP{f?B5^dZv zGKR(kUbgHVeWB=u(LX-&tNd+iBcmPrcIDl&a>dJAP8@w6dWrlxDz9fn^oYFlZ^xoX z z+w*q4u4l(#3`r`O`cWT;-PAF8<58?B2yRX9PVnqnv32vTy!6bio9E=Glw1Hocbzg; zJ#UN^eBMLsCC1DrcpLrxF0?T4dI@+Y24KB{1r*9_+orv9@2{KDf*S<( z{sa?=#P?FPi7SIP=9=AeK!B=DeEh}9$?M1GUiWzfPR8vnk{}PqN0{}% zlhHIIZmma!c>D%q`6>lPRLe5wRHqk%bLEWo%{8fTD4w?)<$Nf{$V8u0@MG# z>jyi~r|NY(L-+*4k}MpphgM5jGebTYIZRsR7g95Cnt9!LdiKN^WcW=4Ue0=J`ml*D zcw)F=LeyQ*uO}S4jel>-yKX#{f7X)pZy`JW zk9~~PMZXvAW6_T8SUd5FKS~ip(c9Lnl>&b}zlyoPc4DEVl}+t@WbWEtjsqsn5Pql? z7#POH%^-|P8-PkXL)x23spmaA^74%20Gbr$S(x<0?jMA$9BR~PZQhtjpE+mA-0P1- zfWMi=P#=b}B97im7^kY?UhO<#}NXsLsp;VD|;XaVcg(^Y?;8#ijzrzViK(z@8X zP$2EgSbEM@J6JevV*C$O@6-tsha*UIl}9mwk3p>8906IhJx9=}=@j+r;D(^rzmT3Y zRz?+?r2P_aj2^zNJ`Y(t)^T*}WO|;CV6+&<+GdY-pk||L)g9Tx#x|^1vFAma zq9;~-GnF^`$mo++;|E6n;gMhGU;m4%W;+$%H3MaaL~fkdveDdh36 zmTmPf<7vjW`WIVZIBIfO)rkFN!PY;)WYXx6={etEc6|j+wt4BZ=J%gY4Z`*Cxi{ZvU75{a;cL9Orc<^6(kmW6OkP)zZms>j zEh&YM`|TE@M-oCt7@14e@kZ`T|dZ{vw^k9Eu$Tm9VJ2lD5$7*JGb*k+Hd zp4C$oNzGBUSOv8heL4SzG zgS^rF`50l3M(5{`#rEMg3xg=!=4k64W?XHUIeS_AC-z9&QNTL6E_6fN^3vEvKYHs$ z&$W%kp3#Bs939V(UNnK2##SFaT7wQU_PnTaFm4#FnZ-9)49;t)HGGZOmUvLwT0Y_( z5lsdapH~Y?aRC~o>t2WV$Jyvf-2{?4%eyKe11v0BT3BSUF|iq6YC2@2D}(&tbtSr> zYZc1hJ1oA@qkqi9_j#DCj{m#+q5C}l;_=s-hI3Jb8*=;&eFlW2*E+SaFx;DY*2wm-RamLdawaZm4_%`9G5&U_< zwSpfLTqpSFf}?_eCpaef@WUy?O2H=y=4_TR<$_lUZWgTh-z^vw2iGSBpC|ZX!L5Ry z5!@#D_k!C6AAx$xGthaRDj1X2xT*xJZI5>g9ufLS1*ZkyFZfEq-xJK4T%64<_-et2 zp$*93AFopcZxwvD;OhimAovEsBZ76tc1-X#p?_NN&4Rxv_*TLEb~#e7Dd~l`uapc!A&t1)nDPDZ!@;<{u}|ZqQx4KD_|# zVa9w?_$vhqG#~Kr@kf$pk2n+x)>+^V!JLi6l#*bT`F6qXr2J5Z9YR;VeFk_sd0rHr zpGlZU&Yhlz@ws#@^mxwku+KBHANn?rey4}O;bA`gXG^|n3sCtT;pM%|Gxdup8`E&RBtB)pFwZtWx)#t z(}r$FzU06zvEX8%*9g`&cAa2tV}}H<5T17nt`>ZUU~Lb-A-GoP&j_v;{71p(3O@EI z#@i^kOz>*KZGu|`UnW@Ft8Icg+Yfuhf-e#LcY@ao{*~Y!!7mH$7yRa<8P|Z|3c*8y zI|OT+M%!H(qix!|1&<2P-v}NP%s;M?By*mKB1vj9LV18TANWEa6-wc&Xr91#A9)MzHo%UlXkT&W{AI68_zSHE;P{BO_l- z@O@ZtxA2@PxL0sYu;$f8f(M137Ca(&4A`ap<3iW+rK8KA`#c_>{u|-XkYrvKe2w6v z@ognzLtQBNZ-rhX_=|!s5PY}bq~Lo5zen)BfDOTEa$KF_WDq5qwPsXF;f!5UEgo5C==fiq&6MBQAxv>}&KlKG*B&%^g8M_+nE zi2vx}EhmQbhdew3-@05{PV_LNaq;@N0z57*pPusQXBLD!$Db17Y7g)B@CdTQh57$H zT(=;U?E+xO^EnUi^>7EOwBs?jocvz~{aO<2<>)`y5B~{h4jg~6hw0tFmP%Bj_$(pFX!Zq}Ksw%qBX^<^1x&;R`+f_X_{R%Ixuc%Hw&+ z!$0(}ALikxPMIK-Fs}8WJDIQYu>m<~FDkuFNK@2V}lNDk3ewZaI z!f+n+@JW>+{oNk^xrhC5?!oJalYfVYeV#vo?)vD`vxv(?&OyNf&50NSW)zwa1G_Nq z_As4Yx_tbc_`NXCdJlNsa84M`Lg0*LI2Er$4*!#fd#XJ;h60XfU2TXNgp=VTpkGS@ zt}lD|dmjFchsk#b|JZ9foQE#(TI+raaK_>rJWP`FJ1-jY`*a^K^LV1b89Lg_h4XJ7 z4@{f|JhuwQKmgYlJo>toxaDPB>mxS@S;9i-p`HA4ovc6y!@B-Kva~JK6xhra}bPzUyuJZ5}bCP|E z!V26H;KLe>srLBC18%HC045Kw1^5vk3H}9UtKc^QZ%4{zkpWi}bazF~^_~r_cS|mw z3I6NA&}f;W<`h#9;8O#uc~Mj6*?fwMh0S{F_ws=MCZV4PdNpL2Vd>-cev!~`m_n!X zPRqmFxQBNF>&RDm9A?^yFGZLOVC#A_@a4eU&3nAGZv$1YsJYoexO{-J@c6Wf8X32;HMC( zUQzSIzzSFtmII#)=s)&k{)ss{;`o1RiUa(#tO24+)co9>8_<7gE(!2I$a)~<`A73t z0sUF?qNf9YqM25?qUI&619131jP}ON^B1K)(0$dc~8|oJ&|BsQf`>Nn$B_F;k_&6z-r-3u(_z0@qB)yOGkG;lm zKg;5sxV!X@d)TKF>zlEb3-L~bzrd77zJ+pm9(cPc^U9^%E0>DMZ1D4nniY{V6#`dA zbfigomE`kF2&Wq1STzr1o{3JZ8h)+UfX?Tgj%cwfFX|8ReE3~pY9jn5a0>8tQ|-xF z6NDKx(a7s;Sg<1-!8Dd!QL{2~N`UJ<{aGbCvrJ^G<}ydQ#_gTA{o$Q-wAZ);xbO7v zxQBguE_Qm$^b(&X>0KS+cQjtGW$UG}*~4ufUK7FVx?EASE`nmP`25IlfG>=EAi(d4 z+!f%9B3};h#gV51+!^_Y0I!ei32=8L&&C`zJrP%fqh>?oq=4QR;pz@vQM1v*mqw}r zdVeGq;DJa_fCnSj2Y4tF_M5|z4+QkfB3xUm;g3Wf32-v>j^Lc;IMs?5oA2ZC?O85N|J3Sc(c6vg( z!=$^iBi&)rU0IOs@|l?V%!};+@o`Aw0`tBIzoi!gZwF=(#VnpfW?WIw6%pSSInq8v z&HE$A2KWP!f&hOg;`)xL`H0t6d^B=i!1Fheivs*{uOHkVxhkOF5qVF5KM}bzz@Lmf z8Q@QO?a5~%&jj?(MxG7uosr)J_^yZ>6-LeHBKoC^>H2&m9D9Eu;(8LigG5~G7&Z4q zT#FbrUy7^=>ifNsIPiJMw`$}S`=)nTJQKJVID^sobhd}b;qGMK>EZp+|G)OGB{t5h z3jhCASkXd(@DeO6lmuL*#E(g0k5ws-XX;wwqOvOv3b)1#pIseo3B^!1eb{8W;kr{Nvo7ime^;QulWcl%$Z zndiTjc0K*;^pl?cP5K#6|2BQr(>K$vdHQ$h3!eUcy6fpbr>}bYR;oW)W#4Y5?kA`f z{11%}TMH`5U&Qy0!p3vS%Q99cKwnK>5uYgu{}s_bFZ54kU%DXltD^se&_8?A{m|Ka z4gGTTjfg%h-<54kyEpw@yjeZeck7EjK)R2z$CBGAe}Ct*pr1?rCO+^bOLI=2w={j= zTSDKCeBickx03ulqF;~bBZg)9sU&YTA=bOkJgRK)?>9A1zs;*@CzcQzp&F|T?42hA-{51FuEeaIZKmQ|8t zhQEZ!PbE2S`2QP}K4H##de}5Peaz&ZK5lkAeZqXg(;qeAE_BL#+4D!tS3Esx+{&vU z@(*{Oaq}myQ!;L5D!8?{*{CFE&HIh(=cEaDp0YXa`BNs`a~?M5JilUQJzX_5&_97c zT*bWe-Qc>=|B&_aN1N{Iv`o>-G@3t(*fgi3Z((i*ULy3;mFzAmY&x?H0(nI+6q|jeac%Rv@G=CNGs-@{m zUl7`){N;9j+W7PA{rJoM$E<_krt?2=-NQ}4hnqe!JarE@eFXVb`n`>Ac4de_-$U*G z)>GXK>0yu^1{rV!IDX;|anm>3oj!8d6!Kx+J!bkLVO}FZYo@yq1O(~Pf$M1v)?mfH z{5ePyg8C%$m4(MES}K{p?grDHi0p*Gz+@=aEv5vCNyv8i?E)bKn~;TsY`_$VvL^Wg zZULDVzg+-bpek6&5n!=^w}6i%FA;vb0;%l9Zx{R&=rYd=sz!5)RjXhpu6tlxunoaE zfj&@hRo(NMdH2r&prs5%gP#VG~ysP>Le_ zcJS3E8JK|I4nB3E_fk$>_6M4~SE7qa#;pfO_*UXW_N+jsegEApDw_9_gkHl)S z;$0ShKTi#vxqP%V5iqD+GCyh!vR1nZOrA2=lusAuB|s#160O@yo@(VtC#QupJs(BS z3_6=xGnU!xaX}b0W|3rrENX6a5+HFf84m-{cb~xUm^i)dKC}%v5t5 zNuRozFU5TjLSzn{fSWwsA8a~T!D0@_!iXk1gCedCQ{tA=Z8?z9eYnNxv)cX8A8aru z&x~LPEKN1H*0=Jk&9r?y-lLi=@EkPHjT|2>*jymu zZpg-Q0Ibq}xfei5J;`aw^@M6zCIz)T%Pu#)7FRK~utaR4J!udJQ=SDaZgJFt;Z|!E zOUNO*LnzZw+~VX?ne$?eG>$!NPwviuG^+ougxdgJlGpz@RwSIe(^}u#EzOwwh9Ve_ z-P;v79P6D|GES39g=?xL1N}?=9f!>4`-hf);S?B?HQ2hnn@0 ziPMqnP_^DMaRiec>eef!h0g0{tvvKxZF!+vn-{5T)TMYA}=z~jW@h$qhm z{b1^`fZly<3s)?w$yt_gB6K2K-&Lz21!gUA z5j8Z$%_Xu<08j5!#lIznPI>^{^=xYw%nea8D^c4ptyp}a5;YF)mAG)2x@sLJEQwUr zHiWZDh>@wR=JC95`!JMzH4tHH62epR)kcJ=$>nUvb=w8~&@RmBW~Z0ou;4$cs*gq( zPP8YQhukx_!o=DI04ulLa}fGx9p5f*^^3^g=`425LRVcKQ=wkuHb6*p8(=Lg;Z`dI z-q}UqmMR45?N~O0Yz+yfvw=5BCP=+&TpF{gq{=7u>?TQM)t@$T_yu#5bmZ7>Ma7Zjp+-0j;1r;$X1ZNT#;$> ziOub14h9N4)HiU}1IyvEg*OPomg&mED1*(5H&(HLVqsAly8;U8orF_m)i8><#9_^7Rn_h z>($3DPS0GZ0#`^G_8TtZZ-hF>K5<*Xfafh7BfU;n7kx=rvOHlrCG8t_DgZ=!Z8#ZK z6>$Ju$)rsi3XV5w(?25`z|qgh#Z?L@fc~JhW(~)>)Q71&x4kLU&j-L}tJ_&asD{lI zL6bV3@Hb#cXMGI?N_!wGM<;DehTwYg%m`X1el66nsI!IoY;$SpJjR&R#cK5eMwnz} zX|YjTT5eP^w){TRs4XwflqXcLw)DiMGOVFQ1?Y+^_W1N%qm0J*y}DE@Gdd?t{`CBO znE^DvKQgyiW*ADkerd7HMJZpFYqRCC5d^f9)anfYW+D3Lmuju{*m8BbTApC&PR`;| zeQtJfdLF%DusoIY^0lYigdTu}*qnfJ4o-8u)k91i01zBcvcf|XbEtz!L8reh_ z1BthVXDYmdJlx#i0@AF6_m;Pvp;2D8tSQ2lWu;vExY889_f%dt!yfsN?2%}T21UNY zBRZ?kEHrC#vyV3FT$A`RQ>#|0i;cPI`8wRD3A8`(mKGPQGYzcHsbp(qkhOIx7%rpx zILQHcimp2#0UY?sz{7^l0PYdWK_|4!d)96%@15cT3j3EkT%4pMnV7 z(QWqE5mVbylCkR|)E2dP;{X5v diff --git a/arch/linux/svgalib/include/event.h b/arch/linux/svgalib/include/event.h deleted file mode 100644 index 1aeaedbd..00000000 --- a/arch/linux/svgalib/include/event.h +++ /dev/null @@ -1,9 +0,0 @@ -// Event header file - -#ifndef _EVENT_H -#define _EVENT_H - -int event_init(); -void event_poll(); - -#endif diff --git a/arch/linux/svgalib/include/key.h b/arch/linux/svgalib/include/key.h deleted file mode 100644 index f7d5514b..00000000 --- a/arch/linux/svgalib/include/key.h +++ /dev/null @@ -1,271 +0,0 @@ -/* -THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -*/ -/* - * $Source: /cvs/cvsroot/d2x/arch/linux/svgalib/include/key.h,v $ - * $Revision: 1.1.1.1 $ - * $Author: bradleyb $ - * $Date: 2001-01-19 03:30:15 $ - * - * Header for keyboard functions - * - * $Log: not supported by cvs2svn $ - * Revision 1.1.1.1 1999/06/14 22:01:46 donut - * Import of d1x 1.37 source. - * - * Revision 1.19 1994/10/24 13:58:12 john - * Hacked in support for pause key onto code 0x61. - * - * Revision 1.18 1994/10/21 15:17:10 john - * Added KEY_PRINT_SCREEN - * - * Revision 1.17 1994/08/31 12:22:13 john - * Added KEY_DEBUGGED - * - * Revision 1.16 1994/08/24 18:53:50 john - * Made Cyberman read like normal mouse; added dpmi module; moved - * mouse from assembly to c. Made mouse buttons return time_down. - * - * Revision 1.15 1994/08/18 14:56:16 john - * *** empty log message *** - * - * Revision 1.14 1994/08/08 10:43:24 john - * Recorded when a key was pressed for key_inkey_time. - * - * Revision 1.13 1994/06/17 17:17:28 john - * Added keyd_time_last_key_was_pressed or something like that. - * - * Revision 1.12 1994/04/29 12:14:19 john - * Locked all memory used during interrupts so that program - * won't hang when using virtual memory. - * - * Revision 1.11 1994/02/17 15:57:14 john - * Changed key libary to C. - * - * Revision 1.10 1994/01/31 08:34:09 john - * Fixed reversed lshift/rshift keys. - * - * Revision 1.9 1994/01/18 10:58:17 john - * *** empty log message *** - * - * Revision 1.8 1993/10/16 19:24:43 matt - * Added new function key_clear_times() & key_clear_counts() - * - * Revision 1.7 1993/10/15 10:17:09 john - * added keyd_last_key_pressed and released for use with recorder. - * - * Revision 1.6 1993/10/06 16:20:37 john - * fixed down arrow bug - * - * Revision 1.5 1993/10/04 13:26:42 john - * changed the #defines for scan codes. - * - * Revision 1.4 1993/09/28 11:35:20 john - * added key_peekkey - * - * Revision 1.3 1993/09/20 18:36:43 john - * *** empty log message *** - * - * Revision 1.1 1993/07/10 13:10:39 matt - * Initial revision - * - * - */ - -#ifndef _KEY_H -#define _KEY_H - -#include "fix.h" -#include "types.h" -#include // For 'toupper' - -//========================================================================== -// This installs the int9 vector and initializes the keyboard in buffered -// ASCII mode. key_close simply undoes that. -extern void key_init(); -extern void key_close(); - -//========================================================================== -// These are configuration parameters to setup how the buffer works. -// set keyd_buffer_type to 0 for no key buffering. -// set it to 1 and it will buffer scancodes. -extern unsigned char keyd_buffer_type; -extern unsigned char keyd_repeat; // 1=allow repeating, 0=dont allow repeat - -// keyd_editor_mode... 0=game mode, 1=editor mode. -// Editor mode makes key_down_time always return 0 if modifiers are down. -extern unsigned char keyd_editor_mode; - -// Time in seconds when last key was pressed... -extern volatile int keyd_time_when_last_pressed; - -//========================================================================== -// These are the "buffered" keypress routines. Use them by setting the -// "keyd_buffer_type" variable. - -extern void key_flush(); // Clears the 256 char buffer -extern int key_checkch(); // Returns 1 if a char is waiting -extern int key_getch(); // Gets key if one waiting other waits for one. -extern int key_inkey(); // Gets key if one, other returns 0. -extern int key_inkey_time(fix *time); // Same as inkey, but returns the time the key was pressed down. -extern int key_peekkey(); // Same as inkey, but doesn't remove key from buffer. - -extern unsigned char key_to_ascii(int keycode ); -extern char *key_name(int keycode); // Convert keycode to the name of the key - -extern void key_debug(); // Does an INT3 - -//========================================================================== -// These are the unbuffered routines. Index by the keyboard scancode. - -// Set to 1 if the key is currently down, else 0 -extern volatile unsigned char keyd_pressed[]; -extern volatile unsigned char keyd_last_pressed; -extern volatile unsigned char keyd_last_released; - -// Returns the seconds this key has been down since last call. -extern fix key_down_time(int scancode); - -// Returns number of times key has went from up to down since last call. -extern unsigned int key_down_count(int scancode); - -// Returns number of times key has went from down to up since last call. -extern unsigned int key_up_count(int scancode); - -// Clears the times & counts used by the above functions -// Took out... use key_flush(); -//void key_clear_times(); -//void key_clear_counts(); - -extern char * key_text[256]; - -#define KEY_SHIFTED 0x100 -#define KEY_ALTED 0x200 -#define KEY_CTRLED 0x400 -#define KEY_DEBUGGED 0x800 - -#define KEY_0 11 -#define KEY_1 2 -#define KEY_2 3 -#define KEY_3 4 -#define KEY_4 5 -#define KEY_5 6 -#define KEY_6 7 -#define KEY_7 8 -#define KEY_8 9 -#define KEY_9 10 - -#define KEY_A 30 -#define KEY_B 48 -#define KEY_C 46 -#define KEY_D 32 -#define KEY_E 18 -#define KEY_F 33 -#define KEY_G 34 -#define KEY_H 35 -#define KEY_I 23 -#define KEY_J 36 -#define KEY_K 37 -#define KEY_L 38 -#define KEY_M 50 -#define KEY_N 49 -#define KEY_O 24 -#define KEY_P 25 -#define KEY_Q 16 -#define KEY_R 19 -#define KEY_S 31 -#define KEY_T 20 -#define KEY_U 22 -#define KEY_V 47 -#define KEY_W 17 -#define KEY_X 45 -#define KEY_Y 21 -#define KEY_Z 44 - -#define KEY_MINUS 12 -#define KEY_EQUAL 13 -#define KEY_DIVIDE 43 -#define KEY_SLASH 28 -#define KEY_COMMA 51 -#define KEY_PERIOD 52 -#define KEY_SEMICOL 39 - -#define KEY_LBRACKET 26 -#define KEY_RBRACKET 27 - -#define KEY_RAPOSTRO 40 -#define KEY_LAPOSTRO 41 - -#define KEY_ESC 1 -#define KEY_ENTER 28 -#define KEY_BACKSP 14 -#define KEY_TAB 15 -#define KEY_SPACEBAR 57 - -#define KEY_NUMLOCK 69 -#define KEY_SCROLLOCK 70 -#define KEY_CAPSLOCK 58 - -#define KEY_LSHIFT 42 -#define KEY_RSHIFT 54 - -#define KEY_LALT 56 -#define KEY_RALT 100 - -#define KEY_LCTRL 29 -#define KEY_RCTRL 97 - -#define KEY_F1 59 -#define KEY_F2 60 -#define KEY_F3 61 -#define KEY_F4 62 -#define KEY_F5 63 -#define KEY_F6 64 -#define KEY_F7 65 -#define KEY_F8 66 -#define KEY_F9 67 -#define KEY_F10 68 -#define KEY_F11 87 -#define KEY_F12 88 - -#define KEY_PAD0 82 -#define KEY_PAD1 79 -#define KEY_PAD2 80 -#define KEY_PAD3 81 -#define KEY_PAD4 75 -#define KEY_PAD5 76 -#define KEY_PAD6 77 -#define KEY_PAD7 71 -#define KEY_PAD8 72 -#define KEY_PAD9 73 -#define KEY_PADMINUS 74 -#define KEY_PADPLUS 78 -#define KEY_PADPERIOD 83 -#define KEY_PADDIVIDE 98 -#define KEY_PADMULTIPLY 55 -#define KEY_PADENTER 96 - -#define KEY_INSERT 110 -#define KEY_HOME 102 -#define KEY_PAGEUP 104 -#define KEY_DELETE 111 -#define KEY_END 107 -#define KEY_PAGEDOWN 109 -#define KEY_UP 103 -#define KEY_DOWN 108 -#define KEY_LEFT 105 -#define KEY_RIGHT 106 - -#define KEY_PRINT_SCREEN 99 -#define KEY_PAUSE 119 - -#endif diff --git a/arch/linux/svgalib/include/mouse.h b/arch/linux/svgalib/include/mouse.h deleted file mode 100644 index 32f37bf9..00000000 --- a/arch/linux/svgalib/include/mouse.h +++ /dev/null @@ -1,127 +0,0 @@ -/* -THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -*/ -/* - * $Source: /cvs/cvsroot/d2x/arch/linux/svgalib/include/mouse.h,v $ - * $Revision: 1.1.1.1 $ - * $Author: bradleyb $ - * $Date: 2001-01-19 03:30:15 $ - * - * Header for mouse functions - * - * $Log: not supported by cvs2svn $ - * Revision 1.1.1.1 1999/06/14 22:01:46 donut - * Import of d1x 1.37 source. - * - * Revision 1.10 1995/02/02 10:22:29 john - * Added cyberman init parameter. - * - * Revision 1.9 1994/11/18 23:18:09 john - * Changed some shorts to ints. - * - * Revision 1.8 1994/09/13 12:33:49 john - * Added functions to get down count and state. - * - * Revision 1.7 1994/08/29 20:52:20 john - * Added better cyberman support; also, joystick calibration - * value return funcctiionn, - * - * Revision 1.6 1994/08/24 17:54:35 john - * *** empty log message *** - * - * Revision 1.5 1994/08/24 17:51:43 john - * Added transparent cyberman support - * - * Revision 1.4 1993/07/27 09:32:22 john - * *** empty log message *** - * - * Revision 1.3 1993/07/26 10:46:44 john - * added definition for mouse_set_pos - * - * Revision 1.2 1993/07/22 13:07:59 john - * added header for mousesetlimts - * - * Revision 1.1 1993/07/10 13:10:40 matt - * Initial revision - * - * - */ - -#ifndef MOUSE_H -#define MOUSE_H - -#include "types.h" -#include "fix.h" - -#define MOUSE_MAX_BUTTONS 8 - -#define MB_LEFT 0 -#define MB_RIGHT 1 -#define MB_MIDDLE 2 -#define MB_Z_UP 3 -#define MB_Z_DOWN 4 -#define MB_PITCH_BACKWARD 5 -#define MB_PITCH_FORWARD 6 -#define MB_BANK_LEFT 7 -#define MB_BANK_RIGHT 8 -#define MB_HEAD_LEFT 9 -#define MB_HEAD_RIGHT 10 - -#define MOUSE_LBTN 1 -#define MOUSE_RBTN 2 -#define MOUSE_MBTN 4 - -#undef NOMOUSE -#ifndef NOMOUSE - -//======================================================================== -// Check for mouse driver, reset driver if installed. returns number of -// buttons if driver is present. - -extern int mouse_set_limits( int x1, int y1, int x2, int y2 ); -extern void mouse_flush(); // clears all mice events... - -//======================================================================== -extern void mouse_get_pos( int *x, int *y); -extern void mouse_get_delta( int *dx, int *dy ); -extern int mouse_get_btns(); -extern void mouse_set_pos( int x, int y); -extern void mouse_get_cyberman_pos( int *x, int *y ); - -// Returns how long this button has been down since last call. -extern fix mouse_button_down_time(int button); - -// Returns how many times this button has went down since last call. -extern int mouse_button_down_count(int button); - -// Returns 1 if this button is currently down -extern int mouse_button_state(int button); - -#else -// 'Neutered' functions... :-) -#define mouse_init(a) -1 -#define mouse_set_limits(a,b,c,d) -1 -#define mouse_flush() -#define mouse_close() -#define mouse_get_pos(a,b) -#define mouse_get_delta(a,b) -#define mouse_get_btns() 0 -#define mouse_set_pos(a,b) -#define mouse_get_cyberman_pos(a,b) -#define mouse_button_down_time(a) 0 -#define mouse_button_down_count(a) 0 -#define mouse_button_state(a) 0 - -#endif - -#endif - diff --git a/arch/linux/svgalib/init.c b/arch/linux/svgalib/init.c deleted file mode 100644 index 3ad24423..00000000 --- a/arch/linux/svgalib/init.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "args.h" - -extern void d_mouse_init(); - -void arch_svgalib_init() -{ - if (!FindArg("-nomouse")) - d_mouse_init(); -} diff --git a/arch/linux_findfile.c b/arch/linux_findfile.c index 6fcb350f..88d606c0 100644 --- a/arch/linux_findfile.c +++ b/arch/linux_findfile.c @@ -1,5 +1,17 @@ +/* + * $Source: /cvs/cvsroot/d2x/arch/linux_findfile.c,v $ + * $Revision: 1.2 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 13:35:08 $ + * + * Linux findfile functions + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include -#ifdef __ENV_LINUX__ +#endif #include #include @@ -53,6 +65,3 @@ int FileFindClose(void) globfree(&glob_a); return 0; } - - -#endif // __ENV_LINUX__ diff --git a/arch/linux_init.c b/arch/linux_init.c index 41330ae6..332815bb 100644 --- a/arch/linux_init.c +++ b/arch/linux_init.c @@ -1,6 +1,17 @@ -// linux init.c - added Matt Mueller 9/6/98 +/* + * $Source: /cvs/cvsroot/d2x/arch/linux_init.c,v $ + * $Revision: 1.4 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 13:35:08 $ + * + * linux init.c - added Matt Mueller 9/6/98 + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include -#ifdef __ENV_LINUX__ +#endif #include #include @@ -27,10 +38,10 @@ void arch_init() { // Initialise the library arch_sdl_init(); -#ifdef __SVGALIB__ +#ifdef SVGALIB_INPUT arch_svgalib_init(); #endif - if (!args_find( "-nojoystick" )) { + if (!FindArg( "-nojoystick" )) { con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_6); joy_init(); } @@ -38,7 +49,7 @@ void arch_init() #ifdef NETWORK //end addition -MM //added on 10/19/98 by Victor Rachels to add serial support (from DPH) - if(!(args_find("-noserial"))) + if(!(FindArg("-noserial"))) com_init(); //end this section addition - Victor //added 06/09/99 Matt Mueller - fix nonetwork compile @@ -46,6 +57,3 @@ void arch_init() //end addition -MM key_init(); } - - -#endif // __ENV_LINUX__ diff --git a/arch/linux_ipx_bsd.c b/arch/linux_ipx_bsd.c index de7f6710..48396b69 100644 --- a/arch/linux_ipx_bsd.c +++ b/arch/linux_ipx_bsd.c @@ -1,8 +1,18 @@ -/* IPX driver using BSD style sockets */ -/* Mostly taken from dosemu */ +/* + * $Source: /cvs/cvsroot/d2x/arch/linux_ipx_bsd.c,v $ + * $Revision: 1.2 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 13:35:08 $ + * + * IPX driver using BSD style sockets + * Mostly taken from dosemu + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include -#ifdef __ENV_LINUX__ -#ifdef NETWORK +#endif #include #include @@ -226,5 +236,3 @@ struct ipx_driver ipx_bsd = { ipx_bsd_ReceivePacket, ipx_general_PacketReady }; -#endif // NETWORK -#endif // __ENV_LINUX__ diff --git a/arch/linux_ipx_lin.c b/arch/linux_ipx_lin.c index 459d4204..81011c7e 100644 --- a/arch/linux_ipx_lin.c +++ b/arch/linux_ipx_lin.c @@ -1,8 +1,18 @@ +/* + * $Source: /cvs/cvsroot/d2x/arch/linux_ipx_lin.c,v $ + * $Revision: 1.2 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 13:35:08 $ + * + * Linux IPX + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include +#endif -#ifdef __ENV_LINUX__ - -#ifdef NETWORK #include #include #include @@ -214,5 +224,3 @@ int ipx_linux_ReceivePacket(ipx_socket_t *s, char *buffer, int bufsize, return size; } -#endif // NETWORK -#endif // __ENV_LINUX__ diff --git a/arch/linux_ipx_udp.c b/arch/linux_ipx_udp.c index 48a11250..f8e0d551 100644 --- a/arch/linux_ipx_udp.c +++ b/arch/linux_ipx_udp.c @@ -1,4 +1,10 @@ -/* IPX driver for native Linux TCP/IP networking (UDP implementation) +/* + * $Source: /cvs/cvsroot/d2x/arch/linux_ipx_udp.c,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 13:35:08 $ + * + * IPX driver for native Linux TCP/IP networking (UDP implementation) * Version 0.99.2 * Contact Jan [Lace] Kratochvil for assistance * (no "It somehow doesn't work! What should I do?" complaints, please) @@ -56,11 +62,14 @@ * ./d1x -udp +UPPER_DISTANT_MACHINE_NAME * * Have fun! + * + * $Log: not supported by cvs2svn $ */ +#ifdef HAVE_CONFIG_H #include -#ifdef __ENV_LINUX__ -#ifdef NETWORK +#endif + #include #include #include /* for htons & co. */ @@ -340,7 +349,7 @@ char *s,*s2,*ns; if (!have_empty_address()) return 0; - if (!((i=args_find("-udp")) && (s=Args[i+1]) && (*s=='=' || *s=='+' || *s=='@'))) s=NULL; + if (!((i=FindArg("-udp")) && (s=Args[i+1]) && (*s=='=' || *s=='+' || *s=='@'))) s=NULL; if (gethostname(buf,sizeof(buf))) FAIL("Error getting my hostname"); if (!(queryhost(buf))) FAIL("Querying my own hostname \"%s\"",buf); @@ -589,5 +598,3 @@ struct ipx_driver ipx_udp = { ipx_udp_ReceivePacket, ipx_general_PacketReady }; -#endif // NETWORK -#endif // __ENV_LINUX__ diff --git a/arch/linux_net.c b/arch/linux_net.c index e96f724b..aa5c3029 100644 --- a/arch/linux_net.c +++ b/arch/linux_net.c @@ -10,10 +10,22 @@ CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ + +/* + * $Source: /cvs/cvsroot/d2x/arch/linux_net.c,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 13:35:09 $ + * + * Linux net + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include +#endif -#ifdef __ENV_LINUX__ -#ifdef NETWORK #include #include #include @@ -98,11 +110,11 @@ int ipx_init( int socket_number, int show_address ) int i; /* DPH: killed kali for now - if (args_find("-kali")) { + if (FindArg("-kali")) { printf("Using Kali for network games\n"); driver = &ipx_kali; //added on 12/20/98 by Jan Kratochvil for direct TCP/IP games - } else*/ if (args_find("-udp")) { + } else*/ if (FindArg("-udp")) { printf("Using native TCP/IP (UDP) for network games\n"); driver = &ipx_udp; //end this section addition - JK @@ -110,7 +122,7 @@ int ipx_init( int socket_number, int show_address ) printf("Using real IPX for network games\n"); driver = &ipx_bsd; } - if ((i = args_find("-ipxnetwork")) && Args[i + 1]) { + if ((i = FindArg("-ipxnetwork")) && Args[i + 1]) { unsigned long n = strtol(Args[i + 1], NULL, 16); ipx_MyAddress[0] = n >> 24; ipx_MyAddress[1] = (n >> 16) & 255; ipx_MyAddress[2] = (n >> 8) & 255; ipx_MyAddress[3] = n & 255; @@ -364,5 +376,3 @@ void ipx_read_network_file(char * filename) } fclose(fp); } -#endif //NETWORK -#endif // __ENV_LINUX__ diff --git a/arch/ogl/include/loadgl.h b/arch/ogl/include/loadgl.h deleted file mode 100644 index 40361dd8..00000000 --- a/arch/ogl/include/loadgl.h +++ /dev/null @@ -1,1935 +0,0 @@ -//loadgl.h - dynamic opengl loading - curtousy (sp) of Jeff Slutter - -#ifndef __LOADGL_H__ -#define __LOADGL_H__ - -#ifndef WIN32 -#ifdef __WINDOWS__ -#define WIN32 -#endif -#endif - -#if defined(WIN32) -#include -#define OGLFUNCCALL __stdcall -#else -#define OGLFUNCCALL -#endif - -#include -#include "types.h" - -#ifdef _cplusplus -#define OEXTERN extern "C" -#else -#define OEXTERN extern -#define true 1 -#define false 0 -#endif - -#ifdef DECLARE_VARS -#define DEFVAR -#else -#define DEFVAR OEXTERN -#endif - -#define glAccum dglAccum -#define glAlphaFunc dglAlphaFunc -#define glAreTexturesResident dglAreTexturesResident -#define glArrayElement dglArrayElement -#define glBegin dglBegin -#define glBindTexture dglBindTexture -#define glBitmap dglBitmap -#define glBlendFunc dglBlendFunc -#define glCallList dglCallList -#define glCallLists dglCallLists -#define glClear dglClear -#define glClearAccum dglClearAccum -#define glClearColor dglClearColor -#define glClearDepth dglClearDepth -#define glClearIndex dglClearIndex -#define glClearStencil dglClearStencil -#define glClipPlane dglClipPlane -#define glColor3b dglColor3b -#define glColor3bv dglColor3bv -#define glColor3d dglColor3d -#define glColor3dv dglColor3dv -#define glColor3f dglColor3f -#define glColor3fv dglColor3fv -#define glColor3i dglColor3i -#define glColor3iv dglColor3iv -#define glColor3s dglColor3s -#define glColor3sv dglColor3sv -#define glColor3ub dglColor3ub -#define glColor3ubv dglColor3ubv -#define glColor3ui dglColor3ui -#define glColor3uiv dglColor3uiv -#define glColor3us dglColor3us -#define glColor3usv dglColor3usv -#define glColor4b dglColor4b -#define glColor4bv dglColor4bv -#define glColor4d dglColor4d -#define glColor4dv dglColor4dv -#define glColor4f dglColor4f -#define glColor4fv dglColor4fv -#define glColor4i dglColor4i -#define glColor4iv dglColor4iv -#define glColor4s dglColor4s -#define glColor4sv dglColor4sv -#define glColor4ub dglColor4ub -#define glColor4ubv dglColor4ubv -#define glColor4ui dglColor4ui -#define glColor4uiv dglColor4uiv -#define glColor4us dglColor4us -#define glColor4usv dglColor4usv -#define glColorMask dglColorMask -#define glColorMaterial dglColorMaterial -#define glColorPointer dglColorPointer -#define glCopyPixels dglCopyPixels -#define glCopyTexImage1D dglCopyTexImage1D -#define glCopyTexImage2D dglCopyTexImage2D -#define glCopyTexSubImage1D dglCopyTexSubImage1D -#define glCopyTexSubImage2D dglCopyTexSubImage2D -#define glCullFace dglCullFace -#define glDeleteLists dglDeleteLists -#define glDeleteTextures dglDeleteTextures -#define glDepthFunc dglDepthFunc -#define glDepthMask dglDepthMask -#define glDepthRange dglDepthRange -#define glDisable dglDisable -#define glDisableClientState dglDisableClientState -#define glDrawArrays dglDrawArrays -#define glDrawBuffer dglDrawBuffer -#define glDrawElements dglDrawElements -#define glDrawPixels dglDrawPixels -#define glEdgeFlag dglEdgeFlag -#define glEdgeFlagPointer dglEdgeFlagPointer -#define glEdgeFlagv dglEdgeFlagv -#define glEnable dglEnable -#define glEnableClientState dglEnableClientState -#define glEnd dglEnd -#define glEndList dglEndList -#define glEvalCoord1d dglEvalCoord1d -#define glEvalCoord1dv dglEvalCoord1dv -#define glEvalCoord1f dglEvalCoord1f -#define glEvalCoord1fv dglEvalCoord1fv -#define glEvalCoord2d dglEvalCoord2d -#define glEvalCoord2dv dglEvalCoord2dv -#define glEvalCoord2f dglEvalCoord2f -#define glEvalCoord2fv dglEvalCoord2fv -#define glEvalMesh1 dglEvalMesh1 -#define glEvalMesh2 dglEvalMesh2 -#define glEvalPoint1 dglEvalPoint1 -#define glEvalPoint2 dglEvalPoint2 -#define glFeedbackBuffer dglFeedbackBuffer -#define glFinish dglFinish -#define glFlush dglFlush -#define glFogf dglFogf -#define glFogfv dglFogfv -#define glFogi dglFogi -#define glFogiv dglFogiv -#define glFrontFace dglFrontFace -#define glFrustum dglFrustum -#define glGenLists dglGenLists -#define glGenTextures dglGenTextures -#define glGetBooleanv dglGetBooleanv -#define glGetClipPlane dglGetClipPlane -#define glGetDoublev dglGetDoublev -#define glGetError dglGetError -#define glGetFloatv dglGetFloatv -#define glGetIntegerv dglGetIntegerv -#define glGetLightfv dglGetLightfv -#define glGetLightiv dglGetLightiv -#define glGetMapdv dglGetMapdv -#define glGetMapfv dglGetMapfv -#define glGetMapiv dglGetMapiv -#define glGetMaterialfv dglGetMaterialfv -#define glGetMaterialiv dglGetMaterialiv -#define glGetPixelMapfv dglGetPixelMapfv -#define glGetPixelMapuiv dglGetPixelMapuiv -#define glGetPixelMapusv dglGetPixelMapusv -#define glGetPointerv dglGetPointerv -#define glGetPolygonStipple dglGetPolygonStipple -#define glGetString dglGetString -#define glGetTexEnvfv dglGetTexEnvfv -#define glGetTexEnviv dglGetTexEnviv -#define glGetTexGendv dglGetTexGendv -#define glGetTexGenfv dglGetTexGenfv -#define glGetTexGeniv dglGetTexGeniv -#define glGetTexImage dglGetTexImage -#define glGetTexLevelParameterfv dglGetTexLevelParameterfv -#define glGetTexLevelParameteriv dglGetTexLevelParameteriv -#define glGetTexParameterfv dglGetTexParameterfv -#define glGetTexParameteriv dglGetTexParameteriv -#define glHint dglHint -#define glIndexMask dglIndexMask -#define glIndexPointer dglIndexPointer -#define glIndexd dglIndexd -#define glIndexdv dglIndexdv -#define glIndexf dglIndexf -#define glIndexfv dglIndexfv -#define glIndexi dglIndexi -#define glIndexiv dglIndexiv -#define glIndexs dglIndexs -#define glIndexsv dglIndexsv -#define glIndexub dglIndexub -#define glIndexubv dglIndexubv -#define glInitNames dglInitNames -#define glInterleavedArrays dglInterleavedArrays -#define glIsEnabled dglIsEnabled -#define glIsList dglIsList -#define glIsTexture dglIsTexture -#define glLightModelf dglLightModelf -#define glLightModelfv dglLightModelfv -#define glLightModeli dglLightModeli -#define glLightModeliv dglLightModeliv -#define glLightf dglLightf -#define glLightfv dglLightfv -#define glLighti dglLighti -#define glLightiv dglLightiv -#define glLineStipple dglLineStipple -#define glLineWidth dglLineWidth -#define glListBase dglListBase -#define glLoadIdentity dglLoadIdentity -#define glLoadMatrixd dglLoadMatrixd -#define glLoadMatrixf dglLoadMatrixf -#define glLoadName dglLoadName -#define glLogicOp dglLogicOp -#define glMap1d dglMap1d -#define glMap1f dglMap1f -#define glMap2d dglMap2d -#define glMap2f dglMap2f -#define glMapGrid1d dglMapGrid1d -#define glMapGrid1f dglMapGrid1f -#define glMapGrid2d dglMapGrid2d -#define glMapGrid2f dglMapGrid2f -#define glMaterialf dglMaterialf -#define glMaterialfv dglMaterialfv -#define glMateriali dglMateriali -#define glMaterialiv dglMaterialiv -#define glMatrixMode dglMatrixMode -#define glMultMatrixd dglMultMatrixd -#define glMultMatrixf dglMultMatrixf -#define glNewList dglNewList -#define glNormal3b dglNormal3b -#define glNormal3bv dglNormal3bv -#define glNormal3d dglNormal3d -#define glNormal3dv dglNormal3dv -#define glNormal3f dglNormal3f -#define glNormal3fv dglNormal3fv -#define glNormal3i dglNormal3i -#define glNormal3iv dglNormal3iv -#define glNormal3s dglNormal3s -#define glNormal3sv dglNormal3sv -#define glNormalPointer dglNormalPointer -#define glOrtho dglOrtho -#define glPassThrough dglPassThrough -#define glPixelMapfv dglPixelMapfv -#define glPixelMapuiv dglPixelMapuiv -#define glPixelMapusv dglPixelMapusv -#define glPixelStoref dglPixelStoref -#define glPixelStorei dglPixelStorei -#define glPixelTransferf dglPixelTransferf -#define glPixelTransferi dglPixelTransferi -#define glPixelZoom dglPixelZoom -#define glPointSize dglPointSize -#define glPolygonMode dglPolygonMode -#define glPolygonOffset dglPolygonOffset -#define glPolygonStipple dglPolygonStipple -#define glPopAttrib dglPopAttrib -#define glPopClientAttrib dglPopClientAttrib -#define glPopMatrix dglPopMatrix -#define glPopName dglPopName -#define glPrioritizeTextures dglPrioritizeTextures -#define glPushAttrib dglPushAttrib -#define glPushClientAttrib dglPushClientAttrib -#define glPushMatrix dglPushMatrix -#define glPushName dglPushName -#define glRasterPos2d dglRasterPos2d -#define glRasterPos2dv dglRasterPos2dv -#define glRasterPos2f dglRasterPos2f -#define glRasterPos2fv dglRasterPos2fv -#define glRasterPos2i dglRasterPos2i -#define glRasterPos2iv dglRasterPos2iv -#define glRasterPos2s dglRasterPos2s -#define glRasterPos2sv dglRasterPos2sv -#define glRasterPos3d dglRasterPos3d -#define glRasterPos3dv dglRasterPos3dv -#define glRasterPos3f dglRasterPos3f -#define glRasterPos3fv dglRasterPos3fv -#define glRasterPos3i dglRasterPos3i -#define glRasterPos3iv dglRasterPos3iv -#define glRasterPos3s dglRasterPos3s -#define glRasterPos3sv dglRasterPos3sv -#define glRasterPos4d dglRasterPos4d -#define glRasterPos4dv dglRasterPos4dv -#define glRasterPos4f dglRasterPos4f -#define glRasterPos4fv dglRasterPos4fv -#define glRasterPos4i dglRasterPos4i -#define glRasterPos4iv dglRasterPos4iv -#define glRasterPos4s dglRasterPos4s -#define glRasterPos4sv dglRasterPos4sv -#define glReadBuffer dglReadBuffer -#define glReadPixels dglReadPixels -#define glRectd dglRectd -#define glRectdv dglRectdv -#define glRectf dglRectf -#define glRectfv dglRectfv -#define glRecti dglRecti -#define glRectiv dglRectiv -#define glRects dglRects -#define glRectsv dglRectsv -#define glRenderMode dglRenderMode -#define glRotated dglRotated -#define glRotatef dglRotatef -#define glScaled dglScaled -#define glScalef dglScalef -#define glScissor dglScissor -#define glSelectBuffer dglSelectBuffer -#define glShadeModel dglShadeModel -#define glStencilFunc dglStencilFunc -#define glStencilMask dglStencilMask -#define glStencilOp dglStencilOp -#define glTexCoord1d dglTexCoord1d -#define glTexCoord1dv dglTexCoord1dv -#define glTexCoord1f dglTexCoord1f -#define glTexCoord1fv dglTexCoord1fv -#define glTexCoord1i dglTexCoord1i -#define glTexCoord1iv dglTexCoord1iv -#define glTexCoord1s dglTexCoord1s -#define glTexCoord1sv dglTexCoord1sv -#define glTexCoord2d dglTexCoord2d -#define glTexCoord2dv dglTexCoord2dv -#define glTexCoord2f dglTexCoord2f -#define glTexCoord2fv dglTexCoord2fv -#define glTexCoord2i dglTexCoord2i -#define glTexCoord2iv dglTexCoord2iv -#define glTexCoord2s dglTexCoord2s -#define glTexCoord2sv dglTexCoord2sv -#define glTexCoord3d dglTexCoord3d -#define glTexCoord3dv dglTexCoord3dv -#define glTexCoord3f dglTexCoord3f -#define glTexCoord3fv dglTexCoord3fv -#define glTexCoord3i dglTexCoord3i -#define glTexCoord3iv dglTexCoord3iv -#define glTexCoord3s dglTexCoord3s -#define glTexCoord3sv dglTexCoord3sv -#define glTexCoord4d dglTexCoord4d -#define glTexCoord4dv dglTexCoord4dv -#define glTexCoord4f dglTexCoord4f -#define glTexCoord4fv dglTexCoord4fv -#define glTexCoord4i dglTexCoord4i -#define glTexCoord4iv dglTexCoord4iv -#define glTexCoord4s dglTexCoord4s -#define glTexCoord4sv dglTexCoord4sv -#define glTexCoordPointer dglTexCoordPointer -#define glTexEnvf dglTexEnvf -#define glTexEnvfv dglTexEnvfv -#define glTexEnvi dglTexEnvi -#define glTexEnviv dglTexEnviv -#define glTexGend dglTexGend -#define glTexGendv dglTexGendv -#define glTexGenf dglTexGenf -#define glTexGenfv dglTexGenfv -#define glTexGeni dglTexGeni -#define glTexGeniv dglTexGeniv -#define glTexImage1D dglTexImage1D -#define glTexImage2D dglTexImage2D -#define glTexParameterf dglTexParameterf -#define glTexParameterfv dglTexParameterfv -#define glTexParameteri dglTexParameteri -#define glTexParameteriv dglTexParameteriv -#define glTexSubImage1D dglTexSubImage1D -#define glTexSubImage2D dglTexSubImage2D -#define glTranslated dglTranslated -#define glTranslatef dglTranslatef -#define glVertex2d dglVertex2d -#define glVertex2dv dglVertex2dv -#define glVertex2f dglVertex2f -#define glVertex2fv dglVertex2fv -#define glVertex2i dglVertex2i -#define glVertex2iv dglVertex2iv -#define glVertex2s dglVertex2s -#define glVertex2sv dglVertex2sv -#define glVertex3d dglVertex3d -#define glVertex3dv dglVertex3dv -#define glVertex3f dglVertex3f -#define glVertex3fv dglVertex3fv -#define glVertex3i dglVertex3i -#define glVertex3iv dglVertex3iv -#define glVertex3s dglVertex3s -#define glVertex3sv dglVertex3sv -#define glVertex4d dglVertex4d -#define glVertex4dv dglVertex4dv -#define glVertex4f dglVertex4f -#define glVertex4fv dglVertex4fv -#define glVertex4i dglVertex4i -#define glVertex4iv dglVertex4iv -#define glVertex4s dglVertex4s -#define glVertex4sv dglVertex4sv -#define glVertexPointer dglVertexPointer -#define glViewport dglViewport - - -#ifdef WIN32 -#define wglCopyContext dwglCopyContext -#define wglCreateContext dwglCreateContext -#define wglCreateLayerContext dwglCreateLayerContext -#define wglDeleteContext dwglDeleteContext -#define wglGetCurrentContext dwglGetCurrentContext -#define wglGetCurrentDC dwglGetCurrentDC -#define wglGetProcAddress dwglGetProcAddress -#define wglMakeCurrent dwglMakeCurrent -#define wglShareLists dwglShareLists -#define wglUseFontBitmapsA dwglUseFontBitmapsA -#define wglUseFontBitmapsW dwglUseFontBitmapsW -#define wglUseFontOutlinesA dwglUseFontOutlinesA -#define wglUseFontOutlinesW dwglUseFontOutlinesW -#define wglDescribeLayerPlane dwglDescribeLayerPlane -#define wglSetLayerPaletteEntries dwglSetLayerPaletteEntries -#define wglGetLayerPaletteEntries dwglGetLayerPaletteEntries -#define wglRealizeLayerPalette dwglRealizeLayerPalette -#define wglSwapLayerBuffers dwglSwapLayerBuffers -#if (WINVER >= 0x0500) -#define wglSwapMultipleBuffers dwglSwapMultipleBuffers -#endif -#endif - -typedef void (OGLFUNCCALL *glAccum_fp)(GLenum op, GLfloat value); -typedef void (OGLFUNCCALL *glAlphaFunc_fp)(GLenum func, GLclampf ref); -typedef GLboolean (OGLFUNCCALL *glAreTexturesResident_fp)(GLsizei n, const GLuint *textures, GLboolean *residences); -typedef void (OGLFUNCCALL *glArrayElement_fp)(GLint i); -typedef void (OGLFUNCCALL *glBegin_fp)(GLenum mode); -typedef void (OGLFUNCCALL *glBindTexture_fp)(GLenum target, GLuint texture); -typedef void (OGLFUNCCALL *glBitmap_fp)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); -typedef void (OGLFUNCCALL *glBlendFunc_fp)(GLenum sfactor, GLenum dfactor); -typedef void (OGLFUNCCALL *glCallList_fp)(GLuint list); -typedef void (OGLFUNCCALL *glCallLists_fp)(GLsizei n, GLenum type, const GLvoid *lists); -typedef void (OGLFUNCCALL *glClear_fp)(GLbitfield mask); -typedef void (OGLFUNCCALL *glClearAccum_fp)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (OGLFUNCCALL *glClearColor_fp)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -typedef void (OGLFUNCCALL *glClearDepth_fp)(GLclampd depth); -typedef void (OGLFUNCCALL *glClearIndex_fp)(GLfloat c); -typedef void (OGLFUNCCALL *glClearStencil_fp)(GLint s); -typedef void (OGLFUNCCALL *glClipPlane_fp)(GLenum plane, const GLdouble *equation); -typedef void (OGLFUNCCALL *glColor3b_fp)(GLbyte red, GLbyte green, GLbyte blue); -typedef void (OGLFUNCCALL *glColor3bv_fp)(const GLbyte *v); -typedef void (OGLFUNCCALL *glColor3d_fp)(GLdouble red, GLdouble green, GLdouble blue); -typedef void (OGLFUNCCALL *glColor3dv_fp)(const GLdouble *v); -typedef void (OGLFUNCCALL *glColor3f_fp)(GLfloat red, GLfloat green, GLfloat blue); -typedef void (OGLFUNCCALL *glColor3fv_fp)(const GLfloat *v); -typedef void (OGLFUNCCALL *glColor3i_fp)(GLint red, GLint green, GLint blue); -typedef void (OGLFUNCCALL *glColor3iv_fp)(const GLint *v); -typedef void (OGLFUNCCALL *glColor3s_fp)(GLshort red, GLshort green, GLshort blue); -typedef void (OGLFUNCCALL *glColor3sv_fp)(const GLshort *v); -typedef void (OGLFUNCCALL *glColor3ub_fp)(GLubyte red, GLubyte green, GLubyte blue); -typedef void (OGLFUNCCALL *glColor3ubv_fp)(const GLubyte *v); -typedef void (OGLFUNCCALL *glColor3ui_fp)(GLuint red, GLuint green, GLuint blue); -typedef void (OGLFUNCCALL *glColor3uiv_fp)(const GLuint *v); -typedef void (OGLFUNCCALL *glColor3us_fp)(GLushort red, GLushort green, GLushort blue); -typedef void (OGLFUNCCALL *glColor3usv_fp)(const GLushort *v); -typedef void (OGLFUNCCALL *glColor4b_fp)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); -typedef void (OGLFUNCCALL *glColor4bv_fp)(const GLbyte *v); -typedef void (OGLFUNCCALL *glColor4d_fp)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); -typedef void (OGLFUNCCALL *glColor4dv_fp)(const GLdouble *v); -typedef void (OGLFUNCCALL *glColor4f_fp)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (OGLFUNCCALL *glColor4fv_fp)(const GLfloat *v); -typedef void (OGLFUNCCALL *glColor4i_fp)(GLint red, GLint green, GLint blue, GLint alpha); -typedef void (OGLFUNCCALL *glColor4iv_fp)(const GLint *v); -typedef void (OGLFUNCCALL *glColor4s_fp)(GLshort red, GLshort green, GLshort blue, GLshort alpha); -typedef void (OGLFUNCCALL *glColor4sv_fp)(const GLshort *v); -typedef void (OGLFUNCCALL *glColor4ub_fp)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); -typedef void (OGLFUNCCALL *glColor4ubv_fp)(const GLubyte *v); -typedef void (OGLFUNCCALL *glColor4ui_fp)(GLuint red, GLuint green, GLuint blue, GLuint alpha); -typedef void (OGLFUNCCALL *glColor4uiv_fp)(const GLuint *v); -typedef void (OGLFUNCCALL *glColor4us_fp)(GLushort red, GLushort green, GLushort blue, GLushort alpha); -typedef void (OGLFUNCCALL *glColor4usv_fp)(const GLushort *v); -typedef void (OGLFUNCCALL *glColorMask_fp)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -typedef void (OGLFUNCCALL *glColorMaterial_fp)(GLenum face, GLenum mode); -typedef void (OGLFUNCCALL *glColorPointer_fp)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (OGLFUNCCALL *glCopyPixels_fp)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); -typedef void (OGLFUNCCALL *glCopyTexImage1D_fp)(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (OGLFUNCCALL *glCopyTexImage2D_fp)(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (OGLFUNCCALL *glCopyTexSubImage1D_fp)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (OGLFUNCCALL *glCopyTexSubImage2D_fp)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (OGLFUNCCALL *glCullFace_fp)(GLenum mode); -typedef void (OGLFUNCCALL *glDeleteLists_fp)(GLuint list, GLsizei range); -typedef void (OGLFUNCCALL *glDeleteTextures_fp)(GLsizei n, const GLuint *textures); -typedef void (OGLFUNCCALL *glDepthFunc_fp)(GLenum func); -typedef void (OGLFUNCCALL *glDepthMask_fp)(GLboolean flag); -typedef void (OGLFUNCCALL *glDepthRange_fp)(GLclampd zNear, GLclampd zFar); -typedef void (OGLFUNCCALL *glDisable_fp)(GLenum cap); -typedef void (OGLFUNCCALL *glDisableClientState_fp)(GLenum array); -typedef void (OGLFUNCCALL *glDrawArrays_fp)(GLenum mode, GLint first, GLsizei count); -typedef void (OGLFUNCCALL *glDrawBuffer_fp)(GLenum mode); -typedef void (OGLFUNCCALL *glDrawElements_fp)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); -typedef void (OGLFUNCCALL *glDrawPixels_fp)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (OGLFUNCCALL *glEdgeFlag_fp)(GLboolean flag); -typedef void (OGLFUNCCALL *glEdgeFlagPointer_fp)(GLsizei stride, const GLvoid *pointer); -typedef void (OGLFUNCCALL *glEdgeFlagv_fp)(const GLboolean *flag); -typedef void (OGLFUNCCALL *glEnable_fp)(GLenum cap); -typedef void (OGLFUNCCALL *glEnableClientState_fp)(GLenum array); -typedef void (OGLFUNCCALL *glEnd_fp)(void); -typedef void (OGLFUNCCALL *glEndList_fp)(void); -typedef void (OGLFUNCCALL *glEvalCoord1d_fp)(GLdouble u); -typedef void (OGLFUNCCALL *glEvalCoord1dv_fp)(const GLdouble *u); -typedef void (OGLFUNCCALL *glEvalCoord1f_fp)(GLfloat u); -typedef void (OGLFUNCCALL *glEvalCoord1fv_fp)(const GLfloat *u); -typedef void (OGLFUNCCALL *glEvalCoord2d_fp)(GLdouble u, GLdouble v); -typedef void (OGLFUNCCALL *glEvalCoord2dv_fp)(const GLdouble *u); -typedef void (OGLFUNCCALL *glEvalCoord2f_fp)(GLfloat u, GLfloat v); -typedef void (OGLFUNCCALL *glEvalCoord2fv_fp)(const GLfloat *u); -typedef void (OGLFUNCCALL *glEvalMesh1_fp)(GLenum mode, GLint i1, GLint i2); -typedef void (OGLFUNCCALL *glEvalMesh2_fp)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); -typedef void (OGLFUNCCALL *glEvalPoint1_fp)(GLint i); -typedef void (OGLFUNCCALL *glEvalPoint2_fp)(GLint i, GLint j); -typedef void (OGLFUNCCALL *glFeedbackBuffer_fp)(GLsizei size, GLenum type, GLfloat *buffer); -typedef void (OGLFUNCCALL *glFinish_fp)(void); -typedef void (OGLFUNCCALL *glFlush_fp)(void); -typedef void (OGLFUNCCALL *glFogf_fp)(GLenum pname, GLfloat param); -typedef void (OGLFUNCCALL *glFogfv_fp)(GLenum pname, const GLfloat *params); -typedef void (OGLFUNCCALL *glFogi_fp)(GLenum pname, GLint param); -typedef void (OGLFUNCCALL *glFogiv_fp)(GLenum pname, const GLint *params); -typedef void (OGLFUNCCALL *glFrontFace_fp)(GLenum mode); -typedef void (OGLFUNCCALL *glFrustum_fp)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef GLuint (OGLFUNCCALL *glGenLists_fp)(GLsizei range); -typedef void (OGLFUNCCALL *glGenTextures_fp)(GLsizei n, GLuint *textures); -typedef void (OGLFUNCCALL *glGetBooleanv_fp)(GLenum pname, GLboolean *params); -typedef void (OGLFUNCCALL *glGetClipPlane_fp)(GLenum plane, GLdouble *equation); -typedef void (OGLFUNCCALL *glGetDoublev_fp)(GLenum pname, GLdouble *params); -typedef GLenum (OGLFUNCCALL *glGetError_fp)(void); -typedef void (OGLFUNCCALL *glGetFloatv_fp)(GLenum pname, GLfloat *params); -typedef void (OGLFUNCCALL *glGetIntegerv_fp)(GLenum pname, GLint *params); -typedef void (OGLFUNCCALL *glGetLightfv_fp)(GLenum light, GLenum pname, GLfloat *params); -typedef void (OGLFUNCCALL *glGetLightiv_fp)(GLenum light, GLenum pname, GLint *params); -typedef void (OGLFUNCCALL *glGetMapdv_fp)(GLenum target, GLenum query, GLdouble *v); -typedef void (OGLFUNCCALL *glGetMapfv_fp)(GLenum target, GLenum query, GLfloat *v); -typedef void (OGLFUNCCALL *glGetMapiv_fp)(GLenum target, GLenum query, GLint *v); -typedef void (OGLFUNCCALL *glGetMaterialfv_fp)(GLenum face, GLenum pname, GLfloat *params); -typedef void (OGLFUNCCALL *glGetMaterialiv_fp)(GLenum face, GLenum pname, GLint *params); -typedef void (OGLFUNCCALL *glGetPixelMapfv_fp)(GLenum map, GLfloat *values); -typedef void (OGLFUNCCALL *glGetPixelMapuiv_fp)(GLenum map, GLuint *values); -typedef void (OGLFUNCCALL *glGetPixelMapusv_fp)(GLenum map, GLushort *values); -typedef void (OGLFUNCCALL *glGetPointerv_fp)(GLenum pname, GLvoid* *params); -typedef void (OGLFUNCCALL *glGetPolygonStipple_fp)(GLubyte *mask); -typedef const GLubyte *(OGLFUNCCALL *glGetString_fp)(GLenum name); -typedef void (OGLFUNCCALL *glGetTexEnvfv_fp)(GLenum target, GLenum pname, GLfloat *params); -typedef void (OGLFUNCCALL *glGetTexEnviv_fp)(GLenum target, GLenum pname, GLint *params); -typedef void (OGLFUNCCALL *glGetTexGendv_fp)(GLenum coord, GLenum pname, GLdouble *params); -typedef void (OGLFUNCCALL *glGetTexGenfv_fp)(GLenum coord, GLenum pname, GLfloat *params); -typedef void (OGLFUNCCALL *glGetTexGeniv_fp)(GLenum coord, GLenum pname, GLint *params); -typedef void (OGLFUNCCALL *glGetTexImage_fp)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); -typedef void (OGLFUNCCALL *glGetTexLevelParameterfv_fp)(GLenum target, GLint level, GLenum pname, GLfloat *params); -typedef void (OGLFUNCCALL *glGetTexLevelParameteriv_fp)(GLenum target, GLint level, GLenum pname, GLint *params); -typedef void (OGLFUNCCALL *glGetTexParameterfv_fp)(GLenum target, GLenum pname, GLfloat *params); -typedef void (OGLFUNCCALL *glGetTexParameteriv_fp)(GLenum target, GLenum pname, GLint *params); -typedef void (OGLFUNCCALL *glHint_fp)(GLenum target, GLenum mode); -typedef void (OGLFUNCCALL *glIndexMask_fp)(GLuint mask); -typedef void (OGLFUNCCALL *glIndexPointer_fp)(GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (OGLFUNCCALL *glIndexd_fp)(GLdouble c); -typedef void (OGLFUNCCALL *glIndexdv_fp)(const GLdouble *c); -typedef void (OGLFUNCCALL *glIndexf_fp)(GLfloat c); -typedef void (OGLFUNCCALL *glIndexfv_fp)(const GLfloat *c); -typedef void (OGLFUNCCALL *glIndexi_fp)(GLint c); -typedef void (OGLFUNCCALL *glIndexiv_fp)(const GLint *c); -typedef void (OGLFUNCCALL *glIndexs_fp)(GLshort c); -typedef void (OGLFUNCCALL *glIndexsv_fp)(const GLshort *c); -typedef void (OGLFUNCCALL *glIndexub_fp)(GLubyte c); -typedef void (OGLFUNCCALL *glIndexubv_fp)(const GLubyte *c); -typedef void (OGLFUNCCALL *glInitNames_fp)(void); -typedef void (OGLFUNCCALL *glInterleavedArrays_fp)(GLenum format, GLsizei stride, const GLvoid *pointer); -typedef GLboolean (OGLFUNCCALL *glIsEnabled_fp)(GLenum cap); -typedef GLboolean (OGLFUNCCALL *glIsList_fp)(GLuint list); -typedef GLboolean (OGLFUNCCALL *glIsTexture_fp)(GLuint texture); -typedef void (OGLFUNCCALL *glLightModelf_fp)(GLenum pname, GLfloat param); -typedef void (OGLFUNCCALL *glLightModelfv_fp)(GLenum pname, const GLfloat *params); -typedef void (OGLFUNCCALL *glLightModeli_fp)(GLenum pname, GLint param); -typedef void (OGLFUNCCALL *glLightModeliv_fp)(GLenum pname, const GLint *params); -typedef void (OGLFUNCCALL *glLightf_fp)(GLenum light, GLenum pname, GLfloat param); -typedef void (OGLFUNCCALL *glLightfv_fp)(GLenum light, GLenum pname, const GLfloat *params); -typedef void (OGLFUNCCALL *glLighti_fp)(GLenum light, GLenum pname, GLint param); -typedef void (OGLFUNCCALL *glLightiv_fp)(GLenum light, GLenum pname, const GLint *params); -typedef void (OGLFUNCCALL *glLineStipple_fp)(GLint factor, GLushort pattern); -typedef void (OGLFUNCCALL *glLineWidth_fp)(GLfloat width); -typedef void (OGLFUNCCALL *glListBase_fp)(GLuint base); -typedef void (OGLFUNCCALL *glLoadIdentity_fp)(void); -typedef void (OGLFUNCCALL *glLoadMatrixd_fp)(const GLdouble *m); -typedef void (OGLFUNCCALL *glLoadMatrixf_fp)(const GLfloat *m); -typedef void (OGLFUNCCALL *glLoadName_fp)(GLuint name); -typedef void (OGLFUNCCALL *glLogicOp_fp)(GLenum opcode); -typedef void (OGLFUNCCALL *glMap1d_fp)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); -typedef void (OGLFUNCCALL *glMap1f_fp)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); -typedef void (OGLFUNCCALL *glMap2d_fp)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); -typedef void (OGLFUNCCALL *glMap2f_fp)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); -typedef void (OGLFUNCCALL *glMapGrid1d_fp)(GLint un, GLdouble u1, GLdouble u2); -typedef void (OGLFUNCCALL *glMapGrid1f_fp)(GLint un, GLfloat u1, GLfloat u2); -typedef void (OGLFUNCCALL *glMapGrid2d_fp)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); -typedef void (OGLFUNCCALL *glMapGrid2f_fp)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); -typedef void (OGLFUNCCALL *glMaterialf_fp)(GLenum face, GLenum pname, GLfloat param); -typedef void (OGLFUNCCALL *glMaterialfv_fp)(GLenum face, GLenum pname, const GLfloat *params); -typedef void (OGLFUNCCALL *glMateriali_fp)(GLenum face, GLenum pname, GLint param); -typedef void (OGLFUNCCALL *glMaterialiv_fp)(GLenum face, GLenum pname, const GLint *params); -typedef void (OGLFUNCCALL *glMatrixMode_fp)(GLenum mode); -typedef void (OGLFUNCCALL *glMultMatrixd_fp)(const GLdouble *m); -typedef void (OGLFUNCCALL *glMultMatrixf_fp)(const GLfloat *m); -typedef void (OGLFUNCCALL *glNewList_fp)(GLuint list, GLenum mode); -typedef void (OGLFUNCCALL *glNormal3b_fp)(GLbyte nx, GLbyte ny, GLbyte nz); -typedef void (OGLFUNCCALL *glNormal3bv_fp)(const GLbyte *v); -typedef void (OGLFUNCCALL *glNormal3d_fp)(GLdouble nx, GLdouble ny, GLdouble nz); -typedef void (OGLFUNCCALL *glNormal3dv_fp)(const GLdouble *v); -typedef void (OGLFUNCCALL *glNormal3f_fp)(GLfloat nx, GLfloat ny, GLfloat nz); -typedef void (OGLFUNCCALL *glNormal3fv_fp)(const GLfloat *v); -typedef void (OGLFUNCCALL *glNormal3i_fp)(GLint nx, GLint ny, GLint nz); -typedef void (OGLFUNCCALL *glNormal3iv_fp)(const GLint *v); -typedef void (OGLFUNCCALL *glNormal3s_fp)(GLshort nx, GLshort ny, GLshort nz); -typedef void (OGLFUNCCALL *glNormal3sv_fp)(const GLshort *v); -typedef void (OGLFUNCCALL *glNormalPointer_fp)(GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (OGLFUNCCALL *glOrtho_fp)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (OGLFUNCCALL *glPassThrough_fp)(GLfloat token); -typedef void (OGLFUNCCALL *glPixelMapfv_fp)(GLenum map, GLsizei mapsize, const GLfloat *values); -typedef void (OGLFUNCCALL *glPixelMapuiv_fp)(GLenum map, GLsizei mapsize, const GLuint *values); -typedef void (OGLFUNCCALL *glPixelMapusv_fp)(GLenum map, GLsizei mapsize, const GLushort *values); -typedef void (OGLFUNCCALL *glPixelStoref_fp)(GLenum pname, GLfloat param); -typedef void (OGLFUNCCALL *glPixelStorei_fp)(GLenum pname, GLint param); -typedef void (OGLFUNCCALL *glPixelTransferf_fp)(GLenum pname, GLfloat param); -typedef void (OGLFUNCCALL *glPixelTransferi_fp)(GLenum pname, GLint param); -typedef void (OGLFUNCCALL *glPixelZoom_fp)(GLfloat xfactor, GLfloat yfactor); -typedef void (OGLFUNCCALL *glPointSize_fp)(GLfloat size); -typedef void (OGLFUNCCALL *glPolygonMode_fp)(GLenum face, GLenum mode); -typedef void (OGLFUNCCALL *glPolygonOffset_fp)(GLfloat factor, GLfloat units); -typedef void (OGLFUNCCALL *glPolygonStipple_fp)(const GLubyte *mask); -typedef void (OGLFUNCCALL *glPopAttrib_fp)(void); -typedef void (OGLFUNCCALL *glPopClientAttrib_fp)(void); -typedef void (OGLFUNCCALL *glPopMatrix_fp)(void); -typedef void (OGLFUNCCALL *glPopName_fp)(void); -typedef void (OGLFUNCCALL *glPrioritizeTextures_fp)(GLsizei n, const GLuint *textures, const GLclampf *priorities); -typedef void (OGLFUNCCALL *glPushAttrib_fp)(GLbitfield mask); -typedef void (OGLFUNCCALL *glPushClientAttrib_fp)(GLbitfield mask); -typedef void (OGLFUNCCALL *glPushMatrix_fp)(void); -typedef void (OGLFUNCCALL *glPushName_fp)(GLuint name); -typedef void (OGLFUNCCALL *glRasterPos2d_fp)(GLdouble x, GLdouble y); -typedef void (OGLFUNCCALL *glRasterPos2dv_fp)(const GLdouble *v); -typedef void (OGLFUNCCALL *glRasterPos2f_fp)(GLfloat x, GLfloat y); -typedef void (OGLFUNCCALL *glRasterPos2fv_fp)(const GLfloat *v); -typedef void (OGLFUNCCALL *glRasterPos2i_fp)(GLint x, GLint y); -typedef void (OGLFUNCCALL *glRasterPos2iv_fp)(const GLint *v); -typedef void (OGLFUNCCALL *glRasterPos2s_fp)(GLshort x, GLshort y); -typedef void (OGLFUNCCALL *glRasterPos2sv_fp)(const GLshort *v); -typedef void (OGLFUNCCALL *glRasterPos3d_fp)(GLdouble x, GLdouble y, GLdouble z); -typedef void (OGLFUNCCALL *glRasterPos3dv_fp)(const GLdouble *v); -typedef void (OGLFUNCCALL *glRasterPos3f_fp)(GLfloat x, GLfloat y, GLfloat z); -typedef void (OGLFUNCCALL *glRasterPos3fv_fp)(const GLfloat *v); -typedef void (OGLFUNCCALL *glRasterPos3i_fp)(GLint x, GLint y, GLint z); -typedef void (OGLFUNCCALL *glRasterPos3iv_fp)(const GLint *v); -typedef void (OGLFUNCCALL *glRasterPos3s_fp)(GLshort x, GLshort y, GLshort z); -typedef void (OGLFUNCCALL *glRasterPos3sv_fp)(const GLshort *v); -typedef void (OGLFUNCCALL *glRasterPos4d_fp)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (OGLFUNCCALL *glRasterPos4dv_fp)(const GLdouble *v); -typedef void (OGLFUNCCALL *glRasterPos4f_fp)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (OGLFUNCCALL *glRasterPos4fv_fp)(const GLfloat *v); -typedef void (OGLFUNCCALL *glRasterPos4i_fp)(GLint x, GLint y, GLint z, GLint w); -typedef void (OGLFUNCCALL *glRasterPos4iv_fp)(const GLint *v); -typedef void (OGLFUNCCALL *glRasterPos4s_fp)(GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (OGLFUNCCALL *glRasterPos4sv_fp)(const GLshort *v); -typedef void (OGLFUNCCALL *glReadBuffer_fp)(GLenum mode); -typedef void (OGLFUNCCALL *glReadPixels_fp)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); -typedef void (OGLFUNCCALL *glRectd_fp)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); -typedef void (OGLFUNCCALL *glRectdv_fp)(const GLdouble *v1, const GLdouble *v2); -typedef void (OGLFUNCCALL *glRectf_fp)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); -typedef void (OGLFUNCCALL *glRectfv_fp)(const GLfloat *v1, const GLfloat *v2); -typedef void (OGLFUNCCALL *glRecti_fp)(GLint x1, GLint y1, GLint x2, GLint y2); -typedef void (OGLFUNCCALL *glRectiv_fp)(const GLint *v1, const GLint *v2); -typedef void (OGLFUNCCALL *glRects_fp)(GLshort x1, GLshort y1, GLshort x2, GLshort y2); -typedef void (OGLFUNCCALL *glRectsv_fp)(const GLshort *v1, const GLshort *v2); -typedef GLint (OGLFUNCCALL *glRenderMode_fp)(GLenum mode); -typedef void (OGLFUNCCALL *glRotated_fp)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -typedef void (OGLFUNCCALL *glRotatef_fp)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -typedef void (OGLFUNCCALL *glScaled_fp)(GLdouble x, GLdouble y, GLdouble z); -typedef void (OGLFUNCCALL *glScalef_fp)(GLfloat x, GLfloat y, GLfloat z); -typedef void (OGLFUNCCALL *glScissor_fp)(GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (OGLFUNCCALL *glSelectBuffer_fp)(GLsizei size, GLuint *buffer); -typedef void (OGLFUNCCALL *glShadeModel_fp)(GLenum mode); -typedef void (OGLFUNCCALL *glStencilFunc_fp)(GLenum func, GLint ref, GLuint mask); -typedef void (OGLFUNCCALL *glStencilMask_fp)(GLuint mask); -typedef void (OGLFUNCCALL *glStencilOp_fp)(GLenum fail, GLenum zfail, GLenum zpass); -typedef void (OGLFUNCCALL *glTexCoord1d_fp)(GLdouble s); -typedef void (OGLFUNCCALL *glTexCoord1dv_fp)(const GLdouble *v); -typedef void (OGLFUNCCALL *glTexCoord1f_fp)(GLfloat s); -typedef void (OGLFUNCCALL *glTexCoord1fv_fp)(const GLfloat *v); -typedef void (OGLFUNCCALL *glTexCoord1i_fp)(GLint s); -typedef void (OGLFUNCCALL *glTexCoord1iv_fp)(const GLint *v); -typedef void (OGLFUNCCALL *glTexCoord1s_fp)(GLshort s); -typedef void (OGLFUNCCALL *glTexCoord1sv_fp)(const GLshort *v); -typedef void (OGLFUNCCALL *glTexCoord2d_fp)(GLdouble s, GLdouble t); -typedef void (OGLFUNCCALL *glTexCoord2dv_fp)(const GLdouble *v); -typedef void (OGLFUNCCALL *glTexCoord2f_fp)(GLfloat s, GLfloat t); -typedef void (OGLFUNCCALL *glTexCoord2fv_fp)(const GLfloat *v); -typedef void (OGLFUNCCALL *glTexCoord2i_fp)(GLint s, GLint t); -typedef void (OGLFUNCCALL *glTexCoord2iv_fp)(const GLint *v); -typedef void (OGLFUNCCALL *glTexCoord2s_fp)(GLshort s, GLshort t); -typedef void (OGLFUNCCALL *glTexCoord2sv_fp)(const GLshort *v); -typedef void (OGLFUNCCALL *glTexCoord3d_fp)(GLdouble s, GLdouble t, GLdouble r); -typedef void (OGLFUNCCALL *glTexCoord3dv_fp)(const GLdouble *v); -typedef void (OGLFUNCCALL *glTexCoord3f_fp)(GLfloat s, GLfloat t, GLfloat r); -typedef void (OGLFUNCCALL *glTexCoord3fv_fp)(const GLfloat *v); -typedef void (OGLFUNCCALL *glTexCoord3i_fp)(GLint s, GLint t, GLint r); -typedef void (OGLFUNCCALL *glTexCoord3iv_fp)(const GLint *v); -typedef void (OGLFUNCCALL *glTexCoord3s_fp)(GLshort s, GLshort t, GLshort r); -typedef void (OGLFUNCCALL *glTexCoord3sv_fp)(const GLshort *v); -typedef void (OGLFUNCCALL *glTexCoord4d_fp)(GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (OGLFUNCCALL *glTexCoord4dv_fp)(const GLdouble *v); -typedef void (OGLFUNCCALL *glTexCoord4f_fp)(GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (OGLFUNCCALL *glTexCoord4fv_fp)(const GLfloat *v); -typedef void (OGLFUNCCALL *glTexCoord4i_fp)(GLint s, GLint t, GLint r, GLint q); -typedef void (OGLFUNCCALL *glTexCoord4iv_fp)(const GLint *v); -typedef void (OGLFUNCCALL *glTexCoord4s_fp)(GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (OGLFUNCCALL *glTexCoord4sv_fp)(const GLshort *v); -typedef void (OGLFUNCCALL *glTexCoordPointer_fp)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (OGLFUNCCALL *glTexEnvf_fp)(GLenum target, GLenum pname, GLfloat param); -typedef void (OGLFUNCCALL *glTexEnvfv_fp)(GLenum target, GLenum pname, const GLfloat *params); -typedef void (OGLFUNCCALL *glTexEnvi_fp)(GLenum target, GLenum pname, GLint param); -typedef void (OGLFUNCCALL *glTexEnviv_fp)(GLenum target, GLenum pname, const GLint *params); -typedef void (OGLFUNCCALL *glTexGend_fp)(GLenum coord, GLenum pname, GLdouble param); -typedef void (OGLFUNCCALL *glTexGendv_fp)(GLenum coord, GLenum pname, const GLdouble *params); -typedef void (OGLFUNCCALL *glTexGenf_fp)(GLenum coord, GLenum pname, GLfloat param); -typedef void (OGLFUNCCALL *glTexGenfv_fp)(GLenum coord, GLenum pname, const GLfloat *params); -typedef void (OGLFUNCCALL *glTexGeni_fp)(GLenum coord, GLenum pname, GLint param); -typedef void (OGLFUNCCALL *glTexGeniv_fp)(GLenum coord, GLenum pname, const GLint *params); -typedef void (OGLFUNCCALL *glTexImage1D_fp)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (OGLFUNCCALL *glTexImage2D_fp)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (OGLFUNCCALL *glTexParameterf_fp)(GLenum target, GLenum pname, GLfloat param); -typedef void (OGLFUNCCALL *glTexParameterfv_fp)(GLenum target, GLenum pname, const GLfloat *params); -typedef void (OGLFUNCCALL *glTexParameteri_fp)(GLenum target, GLenum pname, GLint param); -typedef void (OGLFUNCCALL *glTexParameteriv_fp)(GLenum target, GLenum pname, const GLint *params); -typedef void (OGLFUNCCALL *glTexSubImage1D_fp)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (OGLFUNCCALL *glTexSubImage2D_fp)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (OGLFUNCCALL *glTranslated_fp)(GLdouble x, GLdouble y, GLdouble z); -typedef void (OGLFUNCCALL *glTranslatef_fp)(GLfloat x, GLfloat y, GLfloat z); -typedef void (OGLFUNCCALL *glVertex2d_fp)(GLdouble x, GLdouble y); -typedef void (OGLFUNCCALL *glVertex2dv_fp)(const GLdouble *v); -typedef void (OGLFUNCCALL *glVertex2f_fp)(GLfloat x, GLfloat y); -typedef void (OGLFUNCCALL *glVertex2fv_fp)(const GLfloat *v); -typedef void (OGLFUNCCALL *glVertex2i_fp)(GLint x, GLint y); -typedef void (OGLFUNCCALL *glVertex2iv_fp)(const GLint *v); -typedef void (OGLFUNCCALL *glVertex2s_fp)(GLshort x, GLshort y); -typedef void (OGLFUNCCALL *glVertex2sv_fp)(const GLshort *v); -typedef void (OGLFUNCCALL *glVertex3d_fp)(GLdouble x, GLdouble y, GLdouble z); -typedef void (OGLFUNCCALL *glVertex3dv_fp)(const GLdouble *v); -typedef void (OGLFUNCCALL *glVertex3f_fp)(GLfloat x, GLfloat y, GLfloat z); -typedef void (OGLFUNCCALL *glVertex3fv_fp)(const GLfloat *v); -typedef void (OGLFUNCCALL *glVertex3i_fp)(GLint x, GLint y, GLint z); -typedef void (OGLFUNCCALL *glVertex3iv_fp)(const GLint *v); -typedef void (OGLFUNCCALL *glVertex3s_fp)(GLshort x, GLshort y, GLshort z); -typedef void (OGLFUNCCALL *glVertex3sv_fp)(const GLshort *v); -typedef void (OGLFUNCCALL *glVertex4d_fp)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (OGLFUNCCALL *glVertex4dv_fp)(const GLdouble *v); -typedef void (OGLFUNCCALL *glVertex4f_fp)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (OGLFUNCCALL *glVertex4fv_fp)(const GLfloat *v); -typedef void (OGLFUNCCALL *glVertex4i_fp)(GLint x, GLint y, GLint z, GLint w); -typedef void (OGLFUNCCALL *glVertex4iv_fp)(const GLint *v); -typedef void (OGLFUNCCALL *glVertex4s_fp)(GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (OGLFUNCCALL *glVertex4sv_fp)(const GLshort *v); -typedef void (OGLFUNCCALL *glVertexPointer_fp)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (OGLFUNCCALL *glViewport_fp)(GLint x, GLint y, GLsizei width, GLsizei height); - -#ifdef WIN32 -typedef BOOL (OGLFUNCCALL *wglCopyContext_fp)(HGLRC, HGLRC, UINT); -typedef HGLRC (OGLFUNCCALL *wglCreateContext_fp)(HDC); -typedef HGLRC (OGLFUNCCALL *wglCreateLayerContext_fp)(HDC, int); -typedef BOOL (OGLFUNCCALL *wglDeleteContext_fp)(HGLRC); -typedef HGLRC (OGLFUNCCALL *wglGetCurrentContext_fp)(VOID); -typedef HDC (OGLFUNCCALL *wglGetCurrentDC_fp)(VOID); -typedef PROC (OGLFUNCCALL *wglGetProcAddress_fp)(LPCSTR); -typedef BOOL (OGLFUNCCALL *wglMakeCurrent_fp)(HDC, HGLRC); -typedef BOOL (OGLFUNCCALL *wglShareLists_fp)(HGLRC, HGLRC); -typedef BOOL (OGLFUNCCALL *wglUseFontBitmapsA_fp)(HDC, DWORD, DWORD, DWORD); -typedef BOOL (OGLFUNCCALL *wglUseFontBitmapsW_fp)(HDC, DWORD, DWORD, DWORD); -typedef BOOL (OGLFUNCCALL *wglUseFontOutlinesA_fp)(HDC, DWORD, DWORD, DWORD, FLOAT,FLOAT, int, LPGLYPHMETRICSFLOAT); -typedef BOOL (OGLFUNCCALL *wglUseFontOutlinesW_fp)(HDC, DWORD, DWORD, DWORD, FLOAT,FLOAT, int, LPGLYPHMETRICSFLOAT); -typedef BOOL (OGLFUNCCALL *wglDescribeLayerPlane_fp)(HDC, int, int, UINT,LPLAYERPLANEDESCRIPTOR); -typedef int (OGLFUNCCALL *wglSetLayerPaletteEntries_fp)(HDC, int, int, int,CONST COLORREF *); -typedef int (OGLFUNCCALL *wglGetLayerPaletteEntries_fp)(HDC, int, int, int,COLORREF *); -typedef BOOL (OGLFUNCCALL *wglRealizeLayerPalette_fp)(HDC, int, BOOL); -typedef BOOL (OGLFUNCCALL *wglSwapLayerBuffers_fp)(HDC, UINT); -#if (WINVER >= 0x0500) -typedef DWORD (OGLFUNCCALL *wglSwapMultipleBuffers_fp)(UINT, CONST WGLSWAP *); -#endif -#endif - -DEFVAR glAccum_fp dglAccum; -DEFVAR glAlphaFunc_fp dglAlphaFunc; -DEFVAR glAreTexturesResident_fp dglAreTexturesResident; -DEFVAR glArrayElement_fp dglArrayElement; -DEFVAR glBegin_fp dglBegin; -DEFVAR glBindTexture_fp dglBindTexture; -DEFVAR glBitmap_fp dglBitmap; -DEFVAR glBlendFunc_fp dglBlendFunc; -DEFVAR glCallList_fp dglCallList; -DEFVAR glCallLists_fp dglCallLists; -DEFVAR glClear_fp dglClear; -DEFVAR glClearAccum_fp dglClearAccum; -DEFVAR glClearColor_fp dglClearColor; -DEFVAR glClearDepth_fp dglClearDepth; -DEFVAR glClearIndex_fp dglClearIndex; -DEFVAR glClearStencil_fp dglClearStencil; -DEFVAR glClipPlane_fp dglClipPlane; -DEFVAR glColor3b_fp dglColor3b; -DEFVAR glColor3bv_fp dglColor3bv; -DEFVAR glColor3d_fp dglColor3d; -DEFVAR glColor3dv_fp dglColor3dv; -DEFVAR glColor3f_fp dglColor3f; -DEFVAR glColor3fv_fp dglColor3fv; -DEFVAR glColor3i_fp dglColor3i; -DEFVAR glColor3iv_fp dglColor3iv; -DEFVAR glColor3s_fp dglColor3s; -DEFVAR glColor3sv_fp dglColor3sv; -DEFVAR glColor3ub_fp dglColor3ub; -DEFVAR glColor3ubv_fp dglColor3ubv; -DEFVAR glColor3ui_fp dglColor3ui; -DEFVAR glColor3uiv_fp dglColor3uiv; -DEFVAR glColor3us_fp dglColor3us; -DEFVAR glColor3usv_fp dglColor3usv; -DEFVAR glColor4b_fp dglColor4b; -DEFVAR glColor4bv_fp dglColor4bv; -DEFVAR glColor4d_fp dglColor4d; -DEFVAR glColor4dv_fp dglColor4dv; -DEFVAR glColor4f_fp dglColor4f; -DEFVAR glColor4fv_fp dglColor4fv; -DEFVAR glColor4i_fp dglColor4i; -DEFVAR glColor4iv_fp dglColor4iv; -DEFVAR glColor4s_fp dglColor4s; -DEFVAR glColor4sv_fp dglColor4sv; -DEFVAR glColor4ub_fp dglColor4ub; -DEFVAR glColor4ubv_fp dglColor4ubv; -DEFVAR glColor4ui_fp dglColor4ui; -DEFVAR glColor4uiv_fp dglColor4uiv; -DEFVAR glColor4us_fp dglColor4us; -DEFVAR glColor4usv_fp dglColor4usv; -DEFVAR glColorMask_fp dglColorMask; -DEFVAR glColorMaterial_fp dglColorMaterial; -DEFVAR glColorPointer_fp dglColorPointer; -DEFVAR glCopyPixels_fp dglCopyPixels; -DEFVAR glCopyTexImage1D_fp dglCopyTexImage1D; -DEFVAR glCopyTexImage2D_fp dglCopyTexImage2D; -DEFVAR glCopyTexSubImage1D_fp dglCopyTexSubImage1D; -DEFVAR glCopyTexSubImage2D_fp dglCopyTexSubImage2D; -DEFVAR glCullFace_fp dglCullFace; -DEFVAR glDeleteLists_fp dglDeleteLists; -DEFVAR glDeleteTextures_fp dglDeleteTextures; -DEFVAR glDepthFunc_fp dglDepthFunc; -DEFVAR glDepthMask_fp dglDepthMask; -DEFVAR glDepthRange_fp dglDepthRange; -DEFVAR glDisable_fp dglDisable; -DEFVAR glDisableClientState_fp dglDisableClientState; -DEFVAR glDrawArrays_fp dglDrawArrays; -DEFVAR glDrawBuffer_fp dglDrawBuffer; -DEFVAR glDrawElements_fp dglDrawElements; -DEFVAR glDrawPixels_fp dglDrawPixels; -DEFVAR glEdgeFlag_fp dglEdgeFlag; -DEFVAR glEdgeFlagPointer_fp dglEdgeFlagPointer; -DEFVAR glEdgeFlagv_fp dglEdgeFlagv; -DEFVAR glEnable_fp dglEnable; -DEFVAR glEnableClientState_fp dglEnableClientState; -DEFVAR glEnd_fp dglEnd; -DEFVAR glEndList_fp dglEndList; -DEFVAR glEvalCoord1d_fp dglEvalCoord1d; -DEFVAR glEvalCoord1dv_fp dglEvalCoord1dv; -DEFVAR glEvalCoord1f_fp dglEvalCoord1f; -DEFVAR glEvalCoord1fv_fp dglEvalCoord1fv; -DEFVAR glEvalCoord2d_fp dglEvalCoord2d; -DEFVAR glEvalCoord2dv_fp dglEvalCoord2dv; -DEFVAR glEvalCoord2f_fp dglEvalCoord2f; -DEFVAR glEvalCoord2fv_fp dglEvalCoord2fv; -DEFVAR glEvalMesh1_fp dglEvalMesh1; -DEFVAR glEvalMesh2_fp dglEvalMesh2; -DEFVAR glEvalPoint1_fp dglEvalPoint1; -DEFVAR glEvalPoint2_fp dglEvalPoint2; -DEFVAR glFeedbackBuffer_fp dglFeedbackBuffer; -DEFVAR glFinish_fp dglFinish; -DEFVAR glFlush_fp dglFlush; -DEFVAR glFogf_fp dglFogf; -DEFVAR glFogfv_fp dglFogfv; -DEFVAR glFogi_fp dglFogi; -DEFVAR glFogiv_fp dglFogiv; -DEFVAR glFrontFace_fp dglFrontFace; -DEFVAR glFrustum_fp dglFrustum; -DEFVAR glGenLists_fp dglGenLists; -DEFVAR glGenTextures_fp dglGenTextures; -DEFVAR glGetBooleanv_fp dglGetBooleanv; -DEFVAR glGetClipPlane_fp dglGetClipPlane; -DEFVAR glGetDoublev_fp dglGetDoublev; -DEFVAR glGetError_fp dglGetError; -DEFVAR glGetFloatv_fp dglGetFloatv; -DEFVAR glGetIntegerv_fp dglGetIntegerv; -DEFVAR glGetLightfv_fp dglGetLightfv; -DEFVAR glGetLightiv_fp dglGetLightiv; -DEFVAR glGetMapdv_fp dglGetMapdv; -DEFVAR glGetMapfv_fp dglGetMapfv; -DEFVAR glGetMapiv_fp dglGetMapiv; -DEFVAR glGetMaterialfv_fp dglGetMaterialfv; -DEFVAR glGetMaterialiv_fp dglGetMaterialiv; -DEFVAR glGetPixelMapfv_fp dglGetPixelMapfv; -DEFVAR glGetPixelMapuiv_fp dglGetPixelMapuiv; -DEFVAR glGetPixelMapusv_fp dglGetPixelMapusv; -DEFVAR glGetPointerv_fp dglGetPointerv; -DEFVAR glGetPolygonStipple_fp dglGetPolygonStipple; -DEFVAR glGetString_fp dglGetString; -DEFVAR glGetTexEnvfv_fp dglGetTexEnvfv; -DEFVAR glGetTexEnviv_fp dglGetTexEnviv; -DEFVAR glGetTexGendv_fp dglGetTexGendv; -DEFVAR glGetTexGenfv_fp dglGetTexGenfv; -DEFVAR glGetTexGeniv_fp dglGetTexGeniv; -DEFVAR glGetTexImage_fp dglGetTexImage; -DEFVAR glGetTexLevelParameterfv_fp dglGetTexLevelParameterfv; -DEFVAR glGetTexLevelParameteriv_fp dglGetTexLevelParameteriv; -DEFVAR glGetTexParameterfv_fp dglGetTexParameterfv; -DEFVAR glGetTexParameteriv_fp dglGetTexParameteriv; -DEFVAR glHint_fp dglHint; -DEFVAR glIndexMask_fp dglIndexMask; -DEFVAR glIndexPointer_fp dglIndexPointer; -DEFVAR glIndexd_fp dglIndexd; -DEFVAR glIndexdv_fp dglIndexdv; -DEFVAR glIndexf_fp dglIndexf; -DEFVAR glIndexfv_fp dglIndexfv; -DEFVAR glIndexi_fp dglIndexi; -DEFVAR glIndexiv_fp dglIndexiv; -DEFVAR glIndexs_fp dglIndexs; -DEFVAR glIndexsv_fp dglIndexsv; -DEFVAR glIndexub_fp dglIndexub; -DEFVAR glIndexubv_fp dglIndexubv; -DEFVAR glInitNames_fp dglInitNames; -DEFVAR glInterleavedArrays_fp dglInterleavedArrays; -DEFVAR glIsEnabled_fp dglIsEnabled; -DEFVAR glIsList_fp dglIsList; -DEFVAR glIsTexture_fp dglIsTexture; -DEFVAR glLightModelf_fp dglLightModelf; -DEFVAR glLightModelfv_fp dglLightModelfv; -DEFVAR glLightModeli_fp dglLightModeli; -DEFVAR glLightModeliv_fp dglLightModeliv; -DEFVAR glLightf_fp dglLightf; -DEFVAR glLightfv_fp dglLightfv; -DEFVAR glLighti_fp dglLighti; -DEFVAR glLightiv_fp dglLightiv; -DEFVAR glLineStipple_fp dglLineStipple; -DEFVAR glLineWidth_fp dglLineWidth; -DEFVAR glListBase_fp dglListBase; -DEFVAR glLoadIdentity_fp dglLoadIdentity; -DEFVAR glLoadMatrixd_fp dglLoadMatrixd; -DEFVAR glLoadMatrixf_fp dglLoadMatrixf; -DEFVAR glLoadName_fp dglLoadName; -DEFVAR glLogicOp_fp dglLogicOp; -DEFVAR glMap1d_fp dglMap1d; -DEFVAR glMap1f_fp dglMap1f; -DEFVAR glMap2d_fp dglMap2d; -DEFVAR glMap2f_fp dglMap2f; -DEFVAR glMapGrid1d_fp dglMapGrid1d; -DEFVAR glMapGrid1f_fp dglMapGrid1f; -DEFVAR glMapGrid2d_fp dglMapGrid2d; -DEFVAR glMapGrid2f_fp dglMapGrid2f; -DEFVAR glMaterialf_fp dglMaterialf; -DEFVAR glMaterialfv_fp dglMaterialfv; -DEFVAR glMateriali_fp dglMateriali; -DEFVAR glMaterialiv_fp dglMaterialiv; -DEFVAR glMatrixMode_fp dglMatrixMode; -DEFVAR glMultMatrixd_fp dglMultMatrixd; -DEFVAR glMultMatrixf_fp dglMultMatrixf; -DEFVAR glNewList_fp dglNewList; -DEFVAR glNormal3b_fp dglNormal3b; -DEFVAR glNormal3bv_fp dglNormal3bv; -DEFVAR glNormal3d_fp dglNormal3d; -DEFVAR glNormal3dv_fp dglNormal3dv; -DEFVAR glNormal3f_fp dglNormal3f; -DEFVAR glNormal3fv_fp dglNormal3fv; -DEFVAR glNormal3i_fp dglNormal3i; -DEFVAR glNormal3iv_fp dglNormal3iv; -DEFVAR glNormal3s_fp dglNormal3s; -DEFVAR glNormal3sv_fp dglNormal3sv; -DEFVAR glNormalPointer_fp dglNormalPointer; -DEFVAR glOrtho_fp dglOrtho; -DEFVAR glPassThrough_fp dglPassThrough; -DEFVAR glPixelMapfv_fp dglPixelMapfv; -DEFVAR glPixelMapuiv_fp dglPixelMapuiv; -DEFVAR glPixelMapusv_fp dglPixelMapusv; -DEFVAR glPixelStoref_fp dglPixelStoref; -DEFVAR glPixelStorei_fp dglPixelStorei; -DEFVAR glPixelTransferf_fp dglPixelTransferf; -DEFVAR glPixelTransferi_fp dglPixelTransferi; -DEFVAR glPixelZoom_fp dglPixelZoom; -DEFVAR glPointSize_fp dglPointSize; -DEFVAR glPolygonMode_fp dglPolygonMode; -DEFVAR glPolygonOffset_fp dglPolygonOffset; -DEFVAR glPolygonStipple_fp dglPolygonStipple; -DEFVAR glPopAttrib_fp dglPopAttrib; -DEFVAR glPopClientAttrib_fp dglPopClientAttrib; -DEFVAR glPopMatrix_fp dglPopMatrix; -DEFVAR glPopName_fp dglPopName; -DEFVAR glPrioritizeTextures_fp dglPrioritizeTextures; -DEFVAR glPushAttrib_fp dglPushAttrib; -DEFVAR glPushClientAttrib_fp dglPushClientAttrib; -DEFVAR glPushMatrix_fp dglPushMatrix; -DEFVAR glPushName_fp dglPushName; -DEFVAR glRasterPos2d_fp dglRasterPos2d; -DEFVAR glRasterPos2dv_fp dglRasterPos2dv; -DEFVAR glRasterPos2f_fp dglRasterPos2f; -DEFVAR glRasterPos2fv_fp dglRasterPos2fv; -DEFVAR glRasterPos2i_fp dglRasterPos2i; -DEFVAR glRasterPos2iv_fp dglRasterPos2iv; -DEFVAR glRasterPos2s_fp dglRasterPos2s; -DEFVAR glRasterPos2sv_fp dglRasterPos2sv; -DEFVAR glRasterPos3d_fp dglRasterPos3d; -DEFVAR glRasterPos3dv_fp dglRasterPos3dv; -DEFVAR glRasterPos3f_fp dglRasterPos3f; -DEFVAR glRasterPos3fv_fp dglRasterPos3fv; -DEFVAR glRasterPos3i_fp dglRasterPos3i; -DEFVAR glRasterPos3iv_fp dglRasterPos3iv; -DEFVAR glRasterPos3s_fp dglRasterPos3s; -DEFVAR glRasterPos3sv_fp dglRasterPos3sv; -DEFVAR glRasterPos4d_fp dglRasterPos4d; -DEFVAR glRasterPos4dv_fp dglRasterPos4dv; -DEFVAR glRasterPos4f_fp dglRasterPos4f; -DEFVAR glRasterPos4fv_fp dglRasterPos4fv; -DEFVAR glRasterPos4i_fp dglRasterPos4i; -DEFVAR glRasterPos4iv_fp dglRasterPos4iv; -DEFVAR glRasterPos4s_fp dglRasterPos4s; -DEFVAR glRasterPos4sv_fp dglRasterPos4sv; -DEFVAR glReadBuffer_fp dglReadBuffer; -DEFVAR glReadPixels_fp dglReadPixels; -DEFVAR glRectd_fp dglRectd; -DEFVAR glRectdv_fp dglRectdv; -DEFVAR glRectf_fp dglRectf; -DEFVAR glRectfv_fp dglRectfv; -DEFVAR glRecti_fp dglRecti; -DEFVAR glRectiv_fp dglRectiv; -DEFVAR glRects_fp dglRects; -DEFVAR glRectsv_fp dglRectsv; -DEFVAR glRenderMode_fp dglRenderMode; -DEFVAR glRotated_fp dglRotated; -DEFVAR glRotatef_fp dglRotatef; -DEFVAR glScaled_fp dglScaled; -DEFVAR glScalef_fp dglScalef; -DEFVAR glScissor_fp dglScissor; -DEFVAR glSelectBuffer_fp dglSelectBuffer; -DEFVAR glShadeModel_fp dglShadeModel; -DEFVAR glStencilFunc_fp dglStencilFunc; -DEFVAR glStencilMask_fp dglStencilMask; -DEFVAR glStencilOp_fp dglStencilOp; -DEFVAR glTexCoord1d_fp dglTexCoord1d; -DEFVAR glTexCoord1dv_fp dglTexCoord1dv; -DEFVAR glTexCoord1f_fp dglTexCoord1f; -DEFVAR glTexCoord1fv_fp dglTexCoord1fv; -DEFVAR glTexCoord1i_fp dglTexCoord1i; -DEFVAR glTexCoord1iv_fp dglTexCoord1iv; -DEFVAR glTexCoord1s_fp dglTexCoord1s; -DEFVAR glTexCoord1sv_fp dglTexCoord1sv; -DEFVAR glTexCoord2d_fp dglTexCoord2d; -DEFVAR glTexCoord2dv_fp dglTexCoord2dv; -DEFVAR glTexCoord2f_fp dglTexCoord2f; -DEFVAR glTexCoord2fv_fp dglTexCoord2fv; -DEFVAR glTexCoord2i_fp dglTexCoord2i; -DEFVAR glTexCoord2iv_fp dglTexCoord2iv; -DEFVAR glTexCoord2s_fp dglTexCoord2s; -DEFVAR glTexCoord2sv_fp dglTexCoord2sv; -DEFVAR glTexCoord3d_fp dglTexCoord3d; -DEFVAR glTexCoord3dv_fp dglTexCoord3dv; -DEFVAR glTexCoord3f_fp dglTexCoord3f; -DEFVAR glTexCoord3fv_fp dglTexCoord3fv; -DEFVAR glTexCoord3i_fp dglTexCoord3i; -DEFVAR glTexCoord3iv_fp dglTexCoord3iv; -DEFVAR glTexCoord3s_fp dglTexCoord3s; -DEFVAR glTexCoord3sv_fp dglTexCoord3sv; -DEFVAR glTexCoord4d_fp dglTexCoord4d; -DEFVAR glTexCoord4dv_fp dglTexCoord4dv; -DEFVAR glTexCoord4f_fp dglTexCoord4f; -DEFVAR glTexCoord4fv_fp dglTexCoord4fv; -DEFVAR glTexCoord4i_fp dglTexCoord4i; -DEFVAR glTexCoord4iv_fp dglTexCoord4iv; -DEFVAR glTexCoord4s_fp dglTexCoord4s; -DEFVAR glTexCoord4sv_fp dglTexCoord4sv; -DEFVAR glTexCoordPointer_fp dglTexCoordPointer; -DEFVAR glTexEnvf_fp dglTexEnvf; -DEFVAR glTexEnvfv_fp dglTexEnvfv; -DEFVAR glTexEnvi_fp dglTexEnvi; -DEFVAR glTexEnviv_fp dglTexEnviv; -DEFVAR glTexGend_fp dglTexGend; -DEFVAR glTexGendv_fp dglTexGendv; -DEFVAR glTexGenf_fp dglTexGenf; -DEFVAR glTexGenfv_fp dglTexGenfv; -DEFVAR glTexGeni_fp dglTexGeni; -DEFVAR glTexGeniv_fp dglTexGeniv; -DEFVAR glTexImage1D_fp dglTexImage1D; -DEFVAR glTexImage2D_fp dglTexImage2D; -DEFVAR glTexParameterf_fp dglTexParameterf; -DEFVAR glTexParameterfv_fp dglTexParameterfv; -DEFVAR glTexParameteri_fp dglTexParameteri; -DEFVAR glTexParameteriv_fp dglTexParameteriv; -DEFVAR glTexSubImage1D_fp dglTexSubImage1D; -DEFVAR glTexSubImage2D_fp dglTexSubImage2D; -DEFVAR glTranslated_fp dglTranslated; -DEFVAR glTranslatef_fp dglTranslatef; -DEFVAR glVertex2d_fp dglVertex2d; -DEFVAR glVertex2dv_fp dglVertex2dv; -DEFVAR glVertex2f_fp dglVertex2f; -DEFVAR glVertex2fv_fp dglVertex2fv; -DEFVAR glVertex2i_fp dglVertex2i; -DEFVAR glVertex2iv_fp dglVertex2iv; -DEFVAR glVertex2s_fp dglVertex2s; -DEFVAR glVertex2sv_fp dglVertex2sv; -DEFVAR glVertex3d_fp dglVertex3d; -DEFVAR glVertex3dv_fp dglVertex3dv; -DEFVAR glVertex3f_fp dglVertex3f; -DEFVAR glVertex3fv_fp dglVertex3fv; -DEFVAR glVertex3i_fp dglVertex3i; -DEFVAR glVertex3iv_fp dglVertex3iv; -DEFVAR glVertex3s_fp dglVertex3s; -DEFVAR glVertex3sv_fp dglVertex3sv; -DEFVAR glVertex4d_fp dglVertex4d; -DEFVAR glVertex4dv_fp dglVertex4dv; -DEFVAR glVertex4f_fp dglVertex4f; -DEFVAR glVertex4fv_fp dglVertex4fv; -DEFVAR glVertex4i_fp dglVertex4i; -DEFVAR glVertex4iv_fp dglVertex4iv; -DEFVAR glVertex4s_fp dglVertex4s; -DEFVAR glVertex4sv_fp dglVertex4sv; -DEFVAR glVertexPointer_fp dglVertexPointer; -DEFVAR glViewport_fp dglViewport; - -#ifdef WIN32 -DEFVAR wglCopyContext_fp dwglCopyContext; -DEFVAR wglCreateContext_fp dwglCreateContext; -DEFVAR wglCreateLayerContext_fp dwglCreateLayerContext; -DEFVAR wglDeleteContext_fp dwglDeleteContext; -DEFVAR wglGetCurrentContext_fp dwglGetCurrentContext; -DEFVAR wglGetCurrentDC_fp dwglGetCurrentDC; -DEFVAR wglGetProcAddress_fp dwglGetProcAddress; -DEFVAR wglMakeCurrent_fp dwglMakeCurrent; -DEFVAR wglShareLists_fp dwglShareLists; -DEFVAR wglUseFontBitmapsA_fp dwglUseFontBitmapsA; -DEFVAR wglUseFontBitmapsW_fp dwglUseFontBitmapsW; -DEFVAR wglUseFontOutlinesA_fp dwglUseFontOutlinesA; -DEFVAR wglUseFontOutlinesW_fp dwglUseFontOutlinesW; -DEFVAR wglDescribeLayerPlane_fp dwglDescribeLayerPlane; -DEFVAR wglSetLayerPaletteEntries_fp dwglSetLayerPaletteEntries; -DEFVAR wglGetLayerPaletteEntries_fp dwglGetLayerPaletteEntries; -DEFVAR wglRealizeLayerPalette_fp dwglRealizeLayerPalette; -DEFVAR wglSwapLayerBuffers_fp dwglSwapLayerBuffers; -#if (WINVER >= 0x0500) -DEFVAR wglSwapMultipleBuffers_fp dwglSwapMultipleBuffers; -#endif -#endif - -#ifdef DECLARE_VARS - -// Dynamic module load functions -#ifdef WIN32 -void *dll_LoadModule(const char *name) -{ - HINSTANCE handle; - handle = LoadLibrary(name); - return (void *)handle; -} -void dll_UnloadModule(void *hdl) -{ - HINSTANCE handle; - handle = (HINSTANCE)hdl; - - if(hdl) - { - FreeLibrary(handle); - } -} -void *dll_GetSymbol(void *dllhandle,const char *symname) -{ - if(!dllhandle) - return NULL; - return (void *)GetProcAddress((HINSTANCE)dllhandle,symname); -} -#endif -#ifdef __LINUX__ -#include -void *dll_LoadModule(const char *name) -{ - return (void *)dlopen(name,RTLD_NOW|RTLD_GLOBAL); -} -void dll_UnloadModule(void *hdl) -{ - if(hdl) - { - dlclose(hdl); - } -} -void *dll_GetSymbol(void *dllhandle,const char *symname) -{ - if(!dllhandle) - return NULL; - return dlsym(dllhandle,symname); -} -#endif - -#endif //DECLARE_VARS - -void OpenGL_SetFuncsToNull(void); - -extern char *OglLibPath; - -#ifndef DECLARE_VARS -// pass true to load the library -// pass false to unload it -bool OpenGL_LoadLibrary(bool load);//load=true removed because not c++ -#else -void *OpenGLModuleHandle=NULL; -//char *OglLibPath="opengl32.dll"; -bool OpenGL_LoadLibrary(bool load) -{ - if(load && OpenGLModuleHandle) - return true; - - OpenGL_SetFuncsToNull(); - - if(!load) - { - if(OpenGLModuleHandle) - { - dll_UnloadModule(OpenGLModuleHandle); - OpenGLModuleHandle = NULL; - } - return true; - }else - { - OpenGLModuleHandle = dll_LoadModule(OglLibPath); - if(!OpenGLModuleHandle) - return false; - - dglAccum = (glAccum_fp)dll_GetSymbol(OpenGLModuleHandle,"glAccum"); - dglAlphaFunc = (glAlphaFunc_fp)dll_GetSymbol(OpenGLModuleHandle,"glAlphaFunc"); - dglAreTexturesResident = (glAreTexturesResident_fp)dll_GetSymbol(OpenGLModuleHandle,"glAreTexturesResident"); - dglArrayElement = (glArrayElement_fp)dll_GetSymbol(OpenGLModuleHandle,"glArrayElement"); - dglBegin = (glBegin_fp)dll_GetSymbol(OpenGLModuleHandle,"glBegin"); - dglBindTexture = (glBindTexture_fp)dll_GetSymbol(OpenGLModuleHandle,"glBindTexture"); - dglBitmap = (glBitmap_fp)dll_GetSymbol(OpenGLModuleHandle,"glBitmap"); - dglBlendFunc = (glBlendFunc_fp)dll_GetSymbol(OpenGLModuleHandle,"glBlendFunc"); - dglCallList = (glCallList_fp)dll_GetSymbol(OpenGLModuleHandle,"glCallList"); - dglCallLists = (glCallLists_fp)dll_GetSymbol(OpenGLModuleHandle,"glCallLists"); - dglClear = (glClear_fp)dll_GetSymbol(OpenGLModuleHandle,"glClear"); - dglClearAccum = (glClearAccum_fp)dll_GetSymbol(OpenGLModuleHandle,"glClearAccum"); - dglClearColor = (glClearColor_fp)dll_GetSymbol(OpenGLModuleHandle,"glClearColor"); - dglClearDepth = (glClearDepth_fp)dll_GetSymbol(OpenGLModuleHandle,"glClearDepth"); - dglClearIndex = (glClearIndex_fp)dll_GetSymbol(OpenGLModuleHandle,"glClearIndex"); - dglClearStencil = (glClearStencil_fp)dll_GetSymbol(OpenGLModuleHandle,"glClearStencil"); - dglClipPlane = (glClipPlane_fp)dll_GetSymbol(OpenGLModuleHandle,"glClipPlane"); - dglColor3b = (glColor3b_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor3b"); - dglColor3bv = (glColor3bv_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor3bv"); - dglColor3d = (glColor3d_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor3d"); - dglColor3dv = (glColor3dv_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor3dv"); - dglColor3f = (glColor3f_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor3f"); - dglColor3fv = (glColor3fv_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor3fv"); - dglColor3i = (glColor3i_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor3i"); - dglColor3iv = (glColor3iv_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor3iv"); - dglColor3s = (glColor3s_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor3s"); - dglColor3sv = (glColor3sv_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor3sv"); - dglColor3ub = (glColor3ub_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor3ub"); - dglColor3ubv = (glColor3ubv_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor3ubv"); - dglColor3ui = (glColor3ui_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor3ui"); - dglColor3uiv = (glColor3uiv_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor3uiv"); - dglColor3us = (glColor3us_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor3us"); - dglColor3usv = (glColor3usv_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor3usv"); - dglColor4b = (glColor4b_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor4b"); - dglColor4bv = (glColor4bv_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor4bv"); - dglColor4d = (glColor4d_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor4d"); - dglColor4dv = (glColor4dv_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor4dv"); - dglColor4f = (glColor4f_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor4f"); - dglColor4fv = (glColor4fv_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor4fv"); - dglColor4i = (glColor4i_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor4i"); - dglColor4iv = (glColor4iv_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor4iv"); - dglColor4s = (glColor4s_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor4s"); - dglColor4sv = (glColor4sv_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor4sv"); - dglColor4ub = (glColor4ub_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor4ub"); - dglColor4ubv = (glColor4ubv_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor4ubv"); - dglColor4ui = (glColor4ui_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor4ui"); - dglColor4uiv = (glColor4uiv_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor4uiv"); - dglColor4us = (glColor4us_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor4us"); - dglColor4usv = (glColor4usv_fp)dll_GetSymbol(OpenGLModuleHandle,"glColor4usv"); - dglColorMask = (glColorMask_fp)dll_GetSymbol(OpenGLModuleHandle,"glColorMask"); - dglColorMaterial = (glColorMaterial_fp)dll_GetSymbol(OpenGLModuleHandle,"glColorMaterial"); - dglColorPointer = (glColorPointer_fp)dll_GetSymbol(OpenGLModuleHandle,"glColorPointer"); - dglCopyPixels = (glCopyPixels_fp)dll_GetSymbol(OpenGLModuleHandle,"glCopyPixels"); - dglCopyTexImage1D = (glCopyTexImage1D_fp)dll_GetSymbol(OpenGLModuleHandle,"glCopyTexImage1D"); - dglCopyTexImage2D = (glCopyTexImage2D_fp)dll_GetSymbol(OpenGLModuleHandle,"glCopyTexImage2D"); - dglCopyTexSubImage1D = (glCopyTexSubImage1D_fp)dll_GetSymbol(OpenGLModuleHandle,"glCopyTexSubImage1D"); - dglCopyTexSubImage2D = (glCopyTexSubImage2D_fp)dll_GetSymbol(OpenGLModuleHandle,"glCopyTexSubImage2D"); - dglCullFace = (glCullFace_fp)dll_GetSymbol(OpenGLModuleHandle,"glCullFace"); - dglDeleteLists = (glDeleteLists_fp)dll_GetSymbol(OpenGLModuleHandle,"glDeleteLists"); - dglDeleteTextures = (glDeleteTextures_fp)dll_GetSymbol(OpenGLModuleHandle,"glDeleteTextures"); - dglDepthFunc = (glDepthFunc_fp)dll_GetSymbol(OpenGLModuleHandle,"glDepthFunc"); - dglDepthMask = (glDepthMask_fp)dll_GetSymbol(OpenGLModuleHandle,"glDepthMask"); - dglDepthRange = (glDepthRange_fp)dll_GetSymbol(OpenGLModuleHandle,"glDepthRange"); - dglDisable = (glDisable_fp)dll_GetSymbol(OpenGLModuleHandle,"glDisable"); - dglDisableClientState = (glDisableClientState_fp)dll_GetSymbol(OpenGLModuleHandle,"glDisableClientState"); - dglDrawArrays = (glDrawArrays_fp)dll_GetSymbol(OpenGLModuleHandle,"glDrawArrays"); - dglDrawBuffer = (glDrawBuffer_fp)dll_GetSymbol(OpenGLModuleHandle,"glDrawBuffer"); - dglDrawElements = (glDrawElements_fp)dll_GetSymbol(OpenGLModuleHandle,"glDrawElements"); - dglDrawPixels = (glDrawPixels_fp)dll_GetSymbol(OpenGLModuleHandle,"glDrawPixels"); - dglEdgeFlag = (glEdgeFlag_fp)dll_GetSymbol(OpenGLModuleHandle,"glEdgeFlag"); - dglEdgeFlagPointer = (glEdgeFlagPointer_fp)dll_GetSymbol(OpenGLModuleHandle,"glEdgeFlagPointer"); - dglEdgeFlagv = (glEdgeFlagv_fp)dll_GetSymbol(OpenGLModuleHandle,"glEdgeFlagv"); - dglEnable = (glEnable_fp)dll_GetSymbol(OpenGLModuleHandle,"glEnable"); - dglEnableClientState = (glEnableClientState_fp)dll_GetSymbol(OpenGLModuleHandle,"glEnableClientState"); - dglEnd = (glEnd_fp)dll_GetSymbol(OpenGLModuleHandle,"glEnd"); - dglEndList = (glEndList_fp)dll_GetSymbol(OpenGLModuleHandle,"glEndList"); - dglEvalCoord1d = (glEvalCoord1d_fp)dll_GetSymbol(OpenGLModuleHandle,"glEvalCoord1d"); - dglEvalCoord1dv = (glEvalCoord1dv_fp)dll_GetSymbol(OpenGLModuleHandle,"glEvalCoord1dv"); - dglEvalCoord1f = (glEvalCoord1f_fp)dll_GetSymbol(OpenGLModuleHandle,"glEvalCoord1f"); - dglEvalCoord1fv = (glEvalCoord1fv_fp)dll_GetSymbol(OpenGLModuleHandle,"glEvalCoord1fv"); - dglEvalCoord2d = (glEvalCoord2d_fp)dll_GetSymbol(OpenGLModuleHandle,"glEvalCoord2d"); - dglEvalCoord2dv = (glEvalCoord2dv_fp)dll_GetSymbol(OpenGLModuleHandle,"glEvalCoord2dv"); - dglEvalCoord2f = (glEvalCoord2f_fp)dll_GetSymbol(OpenGLModuleHandle,"glEvalCoord2f"); - dglEvalCoord2fv = (glEvalCoord2fv_fp)dll_GetSymbol(OpenGLModuleHandle,"glEvalCoord2fv"); - dglEvalMesh1 = (glEvalMesh1_fp)dll_GetSymbol(OpenGLModuleHandle,"glEvalMesh1"); - dglEvalMesh2 = (glEvalMesh2_fp)dll_GetSymbol(OpenGLModuleHandle,"glEvalMesh2"); - dglEvalPoint1 = (glEvalPoint1_fp)dll_GetSymbol(OpenGLModuleHandle,"glEvalPoint1"); - dglEvalPoint2 = (glEvalPoint2_fp)dll_GetSymbol(OpenGLModuleHandle,"glEvalPoint2"); - dglFeedbackBuffer = (glFeedbackBuffer_fp)dll_GetSymbol(OpenGLModuleHandle,"glFeedbackBuffer"); - dglFinish = (glFinish_fp)dll_GetSymbol(OpenGLModuleHandle,"glFinish"); - dglFlush = (glFlush_fp)dll_GetSymbol(OpenGLModuleHandle,"glFlush"); - dglFogf = (glFogf_fp)dll_GetSymbol(OpenGLModuleHandle,"glFogf"); - dglFogfv = (glFogfv_fp)dll_GetSymbol(OpenGLModuleHandle,"glFogfv"); - dglFogi = (glFogi_fp)dll_GetSymbol(OpenGLModuleHandle,"glFogi"); - dglFogiv = (glFogiv_fp)dll_GetSymbol(OpenGLModuleHandle,"glFogiv"); - dglFrontFace = (glFrontFace_fp)dll_GetSymbol(OpenGLModuleHandle,"glFrontFace"); - dglFrustum = (glFrustum_fp)dll_GetSymbol(OpenGLModuleHandle,"glFrustum"); - dglGenLists = (glGenLists_fp)dll_GetSymbol(OpenGLModuleHandle,"glGenLists"); - dglGenTextures = (glGenTextures_fp)dll_GetSymbol(OpenGLModuleHandle,"glGenTextures"); - dglGetBooleanv = (glGetBooleanv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetBooleanv"); - dglGetClipPlane = (glGetClipPlane_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetClipPlane"); - dglGetDoublev = (glGetDoublev_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetDoublev"); - dglGetError = (glGetError_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetError"); - dglGetFloatv = (glGetFloatv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetFloatv"); - dglGetIntegerv = (glGetIntegerv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetIntegerv"); - dglGetLightfv = (glGetLightfv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetLightfv"); - dglGetLightiv = (glGetLightiv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetLightiv"); - dglGetMapdv = (glGetMapdv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetMapdv"); - dglGetMapfv = (glGetMapfv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetMapfv"); - dglGetMapiv = (glGetMapiv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetMapiv"); - dglGetMaterialfv = (glGetMaterialfv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetMaterialfv"); - dglGetMaterialiv = (glGetMaterialiv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetMaterialiv"); - dglGetPixelMapfv = (glGetPixelMapfv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetPixelMapfv"); - dglGetPixelMapuiv = (glGetPixelMapuiv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetPixelMapuiv"); - dglGetPixelMapusv = (glGetPixelMapusv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetPixelMapusv"); - dglGetPointerv = (glGetPointerv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetPointerv"); - dglGetPolygonStipple = (glGetPolygonStipple_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetPolygonStipple"); - dglGetString = (glGetString_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetString"); - dglGetTexEnvfv = (glGetTexEnvfv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetTexEnvfv"); - dglGetTexEnviv = (glGetTexEnviv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetTexEnviv"); - dglGetTexGendv = (glGetTexGendv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetTexGendv"); - dglGetTexGenfv = (glGetTexGenfv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetTexGenfv"); - dglGetTexGeniv = (glGetTexGeniv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetTexGeniv"); - dglGetTexImage = (glGetTexImage_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetTexImage"); - dglGetTexLevelParameterfv = (glGetTexLevelParameterfv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetTexLevelParameterfv"); - dglGetTexLevelParameteriv = (glGetTexLevelParameteriv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetTexLevelParameteriv"); - dglGetTexParameterfv = (glGetTexParameterfv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetTexParameterfv"); - dglGetTexParameteriv = (glGetTexParameteriv_fp)dll_GetSymbol(OpenGLModuleHandle,"glGetTexParameteriv"); - dglHint = (glHint_fp)dll_GetSymbol(OpenGLModuleHandle,"glHint"); - dglIndexMask = (glIndexMask_fp)dll_GetSymbol(OpenGLModuleHandle,"glIndexMask"); - dglIndexPointer = (glIndexPointer_fp)dll_GetSymbol(OpenGLModuleHandle,"glIndexPointer"); - dglIndexd = (glIndexd_fp)dll_GetSymbol(OpenGLModuleHandle,"glIndexd"); - dglIndexdv = (glIndexdv_fp)dll_GetSymbol(OpenGLModuleHandle,"glIndexdv"); - dglIndexf = (glIndexf_fp)dll_GetSymbol(OpenGLModuleHandle,"glIndexf"); - dglIndexfv = (glIndexfv_fp)dll_GetSymbol(OpenGLModuleHandle,"glIndexfv"); - dglIndexi = (glIndexi_fp)dll_GetSymbol(OpenGLModuleHandle,"glIndexi"); - dglIndexiv = (glIndexiv_fp)dll_GetSymbol(OpenGLModuleHandle,"glIndexiv"); - dglIndexs = (glIndexs_fp)dll_GetSymbol(OpenGLModuleHandle,"glIndexs"); - dglIndexsv = (glIndexsv_fp)dll_GetSymbol(OpenGLModuleHandle,"glIndexsv"); - dglIndexub = (glIndexub_fp)dll_GetSymbol(OpenGLModuleHandle,"glIndexub"); - dglIndexubv = (glIndexubv_fp)dll_GetSymbol(OpenGLModuleHandle,"glIndexubv"); - dglInitNames = (glInitNames_fp)dll_GetSymbol(OpenGLModuleHandle,"glInitNames"); - dglInterleavedArrays = (glInterleavedArrays_fp)dll_GetSymbol(OpenGLModuleHandle,"glInterleavedArrays"); - dglIsEnabled = (glIsEnabled_fp)dll_GetSymbol(OpenGLModuleHandle,"glIsEnabled"); - dglIsList = (glIsList_fp)dll_GetSymbol(OpenGLModuleHandle,"glIsList"); - dglIsTexture = (glIsTexture_fp)dll_GetSymbol(OpenGLModuleHandle,"glIsTexture"); - dglLightModelf = (glLightModelf_fp)dll_GetSymbol(OpenGLModuleHandle,"glLightModelf"); - dglLightModelfv = (glLightModelfv_fp)dll_GetSymbol(OpenGLModuleHandle,"glLightModelfv"); - dglLightModeli = (glLightModeli_fp)dll_GetSymbol(OpenGLModuleHandle,"glLightModeli"); - dglLightModeliv = (glLightModeliv_fp)dll_GetSymbol(OpenGLModuleHandle,"glLightModeliv"); - dglLightf = (glLightf_fp)dll_GetSymbol(OpenGLModuleHandle,"glLightf"); - dglLightfv = (glLightfv_fp)dll_GetSymbol(OpenGLModuleHandle,"glLightfv"); - dglLighti = (glLighti_fp)dll_GetSymbol(OpenGLModuleHandle,"glLighti"); - dglLightiv = (glLightiv_fp)dll_GetSymbol(OpenGLModuleHandle,"glLightiv"); - dglLineStipple = (glLineStipple_fp)dll_GetSymbol(OpenGLModuleHandle,"glLineStipple"); - dglLineWidth = (glLineWidth_fp)dll_GetSymbol(OpenGLModuleHandle,"glLineWidth"); - dglListBase = (glListBase_fp)dll_GetSymbol(OpenGLModuleHandle,"glListBase"); - dglLoadIdentity = (glLoadIdentity_fp)dll_GetSymbol(OpenGLModuleHandle,"glLoadIdentity"); - dglLoadMatrixd = (glLoadMatrixd_fp)dll_GetSymbol(OpenGLModuleHandle,"glLoadMatrixd"); - dglLoadMatrixf = (glLoadMatrixf_fp)dll_GetSymbol(OpenGLModuleHandle,"glLoadMatrixf"); - dglLoadName = (glLoadName_fp)dll_GetSymbol(OpenGLModuleHandle,"glLoadName"); - dglLogicOp = (glLogicOp_fp)dll_GetSymbol(OpenGLModuleHandle,"glLogicOp"); - dglMap1d = (glMap1d_fp)dll_GetSymbol(OpenGLModuleHandle,"glMap1d"); - dglMap1f = (glMap1f_fp)dll_GetSymbol(OpenGLModuleHandle,"glMap1f"); - dglMap2d = (glMap2d_fp)dll_GetSymbol(OpenGLModuleHandle,"glMap2d"); - dglMap2f = (glMap2f_fp)dll_GetSymbol(OpenGLModuleHandle,"glMap2f"); - dglMapGrid1d = (glMapGrid1d_fp)dll_GetSymbol(OpenGLModuleHandle,"glMapGrid1d"); - dglMapGrid1f = (glMapGrid1f_fp)dll_GetSymbol(OpenGLModuleHandle,"glMapGrid1f"); - dglMapGrid2d = (glMapGrid2d_fp)dll_GetSymbol(OpenGLModuleHandle,"glMapGrid2d"); - dglMapGrid2f = (glMapGrid2f_fp)dll_GetSymbol(OpenGLModuleHandle,"glMapGrid2f"); - dglMaterialf = (glMaterialf_fp)dll_GetSymbol(OpenGLModuleHandle,"glMaterialf"); - dglMaterialfv = (glMaterialfv_fp)dll_GetSymbol(OpenGLModuleHandle,"glMaterialfv"); - dglMateriali = (glMateriali_fp)dll_GetSymbol(OpenGLModuleHandle,"glMateriali"); - dglMaterialiv = (glMaterialiv_fp)dll_GetSymbol(OpenGLModuleHandle,"glMaterialiv"); - dglMatrixMode = (glMatrixMode_fp)dll_GetSymbol(OpenGLModuleHandle,"glMatrixMode"); - dglMultMatrixd = (glMultMatrixd_fp)dll_GetSymbol(OpenGLModuleHandle,"glMultMatrixd"); - dglMultMatrixf = (glMultMatrixf_fp)dll_GetSymbol(OpenGLModuleHandle,"glMultMatrixf"); - dglNewList = (glNewList_fp)dll_GetSymbol(OpenGLModuleHandle,"glNewList"); - dglNormal3b = (glNormal3b_fp)dll_GetSymbol(OpenGLModuleHandle,"glNormal3b"); - dglNormal3bv = (glNormal3bv_fp)dll_GetSymbol(OpenGLModuleHandle,"glNormal3bv"); - dglNormal3d = (glNormal3d_fp)dll_GetSymbol(OpenGLModuleHandle,"glNormal3d"); - dglNormal3dv = (glNormal3dv_fp)dll_GetSymbol(OpenGLModuleHandle,"glNormal3dv"); - dglNormal3f = (glNormal3f_fp)dll_GetSymbol(OpenGLModuleHandle,"glNormal3f"); - dglNormal3fv = (glNormal3fv_fp)dll_GetSymbol(OpenGLModuleHandle,"glNormal3fv"); - dglNormal3i = (glNormal3i_fp)dll_GetSymbol(OpenGLModuleHandle,"glNormal3i"); - dglNormal3iv = (glNormal3iv_fp)dll_GetSymbol(OpenGLModuleHandle,"glNormal3iv"); - dglNormal3s = (glNormal3s_fp)dll_GetSymbol(OpenGLModuleHandle,"glNormal3s"); - dglNormal3sv = (glNormal3sv_fp)dll_GetSymbol(OpenGLModuleHandle,"glNormal3sv"); - dglNormalPointer = (glNormalPointer_fp)dll_GetSymbol(OpenGLModuleHandle,"glNormalPointer"); - dglOrtho = (glOrtho_fp)dll_GetSymbol(OpenGLModuleHandle,"glOrtho"); - dglPassThrough = (glPassThrough_fp)dll_GetSymbol(OpenGLModuleHandle,"glPassThrough"); - dglPixelMapfv = (glPixelMapfv_fp)dll_GetSymbol(OpenGLModuleHandle,"glPixelMapfv"); - dglPixelMapuiv = (glPixelMapuiv_fp)dll_GetSymbol(OpenGLModuleHandle,"glPixelMapuiv"); - dglPixelMapusv = (glPixelMapusv_fp)dll_GetSymbol(OpenGLModuleHandle,"glPixelMapusv"); - dglPixelStoref = (glPixelStoref_fp)dll_GetSymbol(OpenGLModuleHandle,"glPixelStoref"); - dglPixelStorei = (glPixelStorei_fp)dll_GetSymbol(OpenGLModuleHandle,"glPixelStorei"); - dglPixelTransferf = (glPixelTransferf_fp)dll_GetSymbol(OpenGLModuleHandle,"glPixelTransferf"); - dglPixelTransferi = (glPixelTransferi_fp)dll_GetSymbol(OpenGLModuleHandle,"glPixelTransferi"); - dglPixelZoom = (glPixelZoom_fp)dll_GetSymbol(OpenGLModuleHandle,"glPixelZoom"); - dglPointSize = (glPointSize_fp)dll_GetSymbol(OpenGLModuleHandle,"glPointSize"); - dglPolygonMode = (glPolygonMode_fp)dll_GetSymbol(OpenGLModuleHandle,"glPolygonMode"); - dglPolygonOffset = (glPolygonOffset_fp)dll_GetSymbol(OpenGLModuleHandle,"glPolygonOffset"); - dglPolygonStipple = (glPolygonStipple_fp)dll_GetSymbol(OpenGLModuleHandle,"glPolygonStipple"); - dglPopAttrib = (glPopAttrib_fp)dll_GetSymbol(OpenGLModuleHandle,"glPopAttrib"); - dglPopClientAttrib = (glPopClientAttrib_fp)dll_GetSymbol(OpenGLModuleHandle,"glPopClientAttrib"); - dglPopMatrix = (glPopMatrix_fp)dll_GetSymbol(OpenGLModuleHandle,"glPopMatrix"); - dglPopName = (glPopName_fp)dll_GetSymbol(OpenGLModuleHandle,"glPopName"); - dglPrioritizeTextures = (glPrioritizeTextures_fp)dll_GetSymbol(OpenGLModuleHandle,"glPrioritizeTextures"); - dglPushAttrib = (glPushAttrib_fp)dll_GetSymbol(OpenGLModuleHandle,"glPushAttrib"); - dglPushClientAttrib = (glPushClientAttrib_fp)dll_GetSymbol(OpenGLModuleHandle,"glPushClientAttrib"); - dglPushMatrix = (glPushMatrix_fp)dll_GetSymbol(OpenGLModuleHandle,"glPushMatrix"); - dglPushName = (glPushName_fp)dll_GetSymbol(OpenGLModuleHandle,"glPushName"); - dglRasterPos2d = (glRasterPos2d_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos2d"); - dglRasterPos2dv = (glRasterPos2dv_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos2dv"); - dglRasterPos2f = (glRasterPos2f_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos2f"); - dglRasterPos2fv = (glRasterPos2fv_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos2fv"); - dglRasterPos2i = (glRasterPos2i_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos2i"); - dglRasterPos2iv = (glRasterPos2iv_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos2iv"); - dglRasterPos2s = (glRasterPos2s_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos2s"); - dglRasterPos2sv = (glRasterPos2sv_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos2sv"); - dglRasterPos3d = (glRasterPos3d_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos3d"); - dglRasterPos3dv = (glRasterPos3dv_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos3dv"); - dglRasterPos3f = (glRasterPos3f_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos3f"); - dglRasterPos3fv = (glRasterPos3fv_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos3fv"); - dglRasterPos3i = (glRasterPos3i_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos3i"); - dglRasterPos3iv = (glRasterPos3iv_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos3iv"); - dglRasterPos3s = (glRasterPos3s_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos3s"); - dglRasterPos3sv = (glRasterPos3sv_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos3sv"); - dglRasterPos4d = (glRasterPos4d_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos4d"); - dglRasterPos4dv = (glRasterPos4dv_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos4dv"); - dglRasterPos4f = (glRasterPos4f_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos4f"); - dglRasterPos4fv = (glRasterPos4fv_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos4fv"); - dglRasterPos4i = (glRasterPos4i_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos4i"); - dglRasterPos4iv = (glRasterPos4iv_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos4iv"); - dglRasterPos4s = (glRasterPos4s_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos4s"); - dglRasterPos4sv = (glRasterPos4sv_fp)dll_GetSymbol(OpenGLModuleHandle,"glRasterPos4sv"); - dglReadBuffer = (glReadBuffer_fp)dll_GetSymbol(OpenGLModuleHandle,"glReadBuffer"); - dglReadPixels = (glReadPixels_fp)dll_GetSymbol(OpenGLModuleHandle,"glReadPixels"); - dglRectd = (glRectd_fp)dll_GetSymbol(OpenGLModuleHandle,"glRectd"); - dglRectdv = (glRectdv_fp)dll_GetSymbol(OpenGLModuleHandle,"glRectdv"); - dglRectf = (glRectf_fp)dll_GetSymbol(OpenGLModuleHandle,"glRectf"); - dglRectfv = (glRectfv_fp)dll_GetSymbol(OpenGLModuleHandle,"glRectfv"); - dglRecti = (glRecti_fp)dll_GetSymbol(OpenGLModuleHandle,"glRecti"); - dglRectiv = (glRectiv_fp)dll_GetSymbol(OpenGLModuleHandle,"glRectiv"); - dglRects = (glRects_fp)dll_GetSymbol(OpenGLModuleHandle,"glRects"); - dglRectsv = (glRectsv_fp)dll_GetSymbol(OpenGLModuleHandle,"glRectsv"); - dglRenderMode = (glRenderMode_fp)dll_GetSymbol(OpenGLModuleHandle,"glRenderMode"); - dglRotated = (glRotated_fp)dll_GetSymbol(OpenGLModuleHandle,"glRotated"); - dglRotatef = (glRotatef_fp)dll_GetSymbol(OpenGLModuleHandle,"glRotatef"); - dglScaled = (glScaled_fp)dll_GetSymbol(OpenGLModuleHandle,"glScaled"); - dglScalef = (glScalef_fp)dll_GetSymbol(OpenGLModuleHandle,"glScalef"); - dglScissor = (glScissor_fp)dll_GetSymbol(OpenGLModuleHandle,"glScissor"); - dglSelectBuffer = (glSelectBuffer_fp)dll_GetSymbol(OpenGLModuleHandle,"glSelectBuffer"); - dglShadeModel = (glShadeModel_fp)dll_GetSymbol(OpenGLModuleHandle,"glShadeModel"); - dglStencilFunc = (glStencilFunc_fp)dll_GetSymbol(OpenGLModuleHandle,"glStencilFunc"); - dglStencilMask = (glStencilMask_fp)dll_GetSymbol(OpenGLModuleHandle,"glStencilMask"); - dglStencilOp = (glStencilOp_fp)dll_GetSymbol(OpenGLModuleHandle,"glStencilOp"); - dglTexCoord1d = (glTexCoord1d_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord1d"); - dglTexCoord1dv = (glTexCoord1dv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord1dv"); - dglTexCoord1f = (glTexCoord1f_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord1f"); - dglTexCoord1fv = (glTexCoord1fv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord1fv"); - dglTexCoord1i = (glTexCoord1i_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord1i"); - dglTexCoord1iv = (glTexCoord1iv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord1iv"); - dglTexCoord1s = (glTexCoord1s_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord1s"); - dglTexCoord1sv = (glTexCoord1sv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord1sv"); - dglTexCoord2d = (glTexCoord2d_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord2d"); - dglTexCoord2dv = (glTexCoord2dv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord2dv"); - dglTexCoord2f = (glTexCoord2f_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord2f"); - dglTexCoord2fv = (glTexCoord2fv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord2fv"); - dglTexCoord2i = (glTexCoord2i_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord2i"); - dglTexCoord2iv = (glTexCoord2iv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord2iv"); - dglTexCoord2s = (glTexCoord2s_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord2s"); - dglTexCoord2sv = (glTexCoord2sv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord2sv"); - dglTexCoord3d = (glTexCoord3d_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord3d"); - dglTexCoord3dv = (glTexCoord3dv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord3dv"); - dglTexCoord3f = (glTexCoord3f_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord3f"); - dglTexCoord3fv = (glTexCoord3fv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord3fv"); - dglTexCoord3i = (glTexCoord3i_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord3i"); - dglTexCoord3iv = (glTexCoord3iv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord3iv"); - dglTexCoord3s = (glTexCoord3s_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord3s"); - dglTexCoord3sv = (glTexCoord3sv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord3sv"); - dglTexCoord4d = (glTexCoord4d_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord4d"); - dglTexCoord4dv = (glTexCoord4dv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord4dv"); - dglTexCoord4f = (glTexCoord4f_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord4f"); - dglTexCoord4fv = (glTexCoord4fv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord4fv"); - dglTexCoord4i = (glTexCoord4i_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord4i"); - dglTexCoord4iv = (glTexCoord4iv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord4iv"); - dglTexCoord4s = (glTexCoord4s_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord4s"); - dglTexCoord4sv = (glTexCoord4sv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoord4sv"); - dglTexCoordPointer = (glTexCoordPointer_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexCoordPointer"); - dglTexEnvf = (glTexEnvf_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexEnvf"); - dglTexEnvfv = (glTexEnvfv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexEnvfv"); - dglTexEnvi = (glTexEnvi_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexEnvi"); - dglTexEnviv = (glTexEnviv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexEnviv"); - dglTexGend = (glTexGend_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexGend"); - dglTexGendv = (glTexGendv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexGendv"); - dglTexGenf = (glTexGenf_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexGenf"); - dglTexGenfv = (glTexGenfv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexGenfv"); - dglTexGeni = (glTexGeni_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexGeni"); - dglTexGeniv = (glTexGeniv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexGeniv"); - dglTexImage1D = (glTexImage1D_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexImage1D"); - dglTexImage2D = (glTexImage2D_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexImage2D"); - dglTexParameterf = (glTexParameterf_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexParameterf"); - dglTexParameterfv = (glTexParameterfv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexParameterfv"); - dglTexParameteri = (glTexParameteri_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexParameteri"); - dglTexParameteriv = (glTexParameteriv_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexParameteriv"); - dglTexSubImage1D = (glTexSubImage1D_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexSubImage1D"); - dglTexSubImage2D = (glTexSubImage2D_fp)dll_GetSymbol(OpenGLModuleHandle,"glTexSubImage2D"); - dglTranslated = (glTranslated_fp)dll_GetSymbol(OpenGLModuleHandle,"glTranslated"); - dglTranslatef = (glTranslatef_fp)dll_GetSymbol(OpenGLModuleHandle,"glTranslatef"); - dglVertex2d = (glVertex2d_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex2d"); - dglVertex2dv = (glVertex2dv_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex2dv"); - dglVertex2f = (glVertex2f_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex2f"); - dglVertex2fv = (glVertex2fv_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex2fv"); - dglVertex2i = (glVertex2i_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex2i"); - dglVertex2iv = (glVertex2iv_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex2iv"); - dglVertex2s = (glVertex2s_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex2s"); - dglVertex2sv = (glVertex2sv_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex2sv"); - dglVertex3d = (glVertex3d_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex3d"); - dglVertex3dv = (glVertex3dv_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex3dv"); - dglVertex3f = (glVertex3f_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex3f"); - dglVertex3fv = (glVertex3fv_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex3fv"); - dglVertex3i = (glVertex3i_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex3i"); - dglVertex3iv = (glVertex3iv_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex3iv"); - dglVertex3s = (glVertex3s_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex3s"); - dglVertex3sv = (glVertex3sv_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex3sv"); - dglVertex4d = (glVertex4d_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex4d"); - dglVertex4dv = (glVertex4dv_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex4dv"); - dglVertex4f = (glVertex4f_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex4f"); - dglVertex4fv = (glVertex4fv_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex4fv"); - dglVertex4i = (glVertex4i_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex4i"); - dglVertex4iv = (glVertex4iv_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex4iv"); - dglVertex4s = (glVertex4s_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex4s"); - dglVertex4sv = (glVertex4sv_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertex4sv"); - dglVertexPointer = (glVertexPointer_fp)dll_GetSymbol(OpenGLModuleHandle,"glVertexPointer"); - dglViewport = (glViewport_fp)dll_GetSymbol(OpenGLModuleHandle,"glViewport"); - -#ifdef WIN32 - dwglCopyContext = (wglCopyContext_fp)dll_GetSymbol(OpenGLModuleHandle,"wglCopyContext"); - dwglCreateContext = (wglCreateContext_fp)dll_GetSymbol(OpenGLModuleHandle,"wglCreateContext"); - dwglCreateLayerContext = (wglCreateLayerContext_fp)dll_GetSymbol(OpenGLModuleHandle,"wglCreateLayerContext"); - dwglDeleteContext = (wglDeleteContext_fp)dll_GetSymbol(OpenGLModuleHandle,"wglDeleteContext"); - dwglGetCurrentContext = (wglGetCurrentContext_fp)dll_GetSymbol(OpenGLModuleHandle,"wglGetCurrentContext"); - dwglGetCurrentDC = (wglGetCurrentDC_fp)dll_GetSymbol(OpenGLModuleHandle,"wglGetCurrentDC"); - dwglGetProcAddress = (wglGetProcAddress_fp)dll_GetSymbol(OpenGLModuleHandle,"wglGetProcAddress"); - dwglMakeCurrent = (wglMakeCurrent_fp)dll_GetSymbol(OpenGLModuleHandle,"wglMakeCurrent"); - dwglShareLists = (wglShareLists_fp)dll_GetSymbol(OpenGLModuleHandle,"wglShareLists"); - dwglUseFontBitmapsA = (wglUseFontBitmapsA_fp)dll_GetSymbol(OpenGLModuleHandle,"wglUseFontBitmapsA"); - dwglUseFontBitmapsW = (wglUseFontBitmapsW_fp)dll_GetSymbol(OpenGLModuleHandle,"wglUseFontBitmapsW"); - dwglUseFontOutlinesA = (wglUseFontOutlinesA_fp)dll_GetSymbol(OpenGLModuleHandle,"wglUseFontOutlinesA"); - dwglUseFontOutlinesW = (wglUseFontOutlinesW_fp)dll_GetSymbol(OpenGLModuleHandle,"wglUseFontOutlinesW"); - dwglDescribeLayerPlane = (wglDescribeLayerPlane_fp)dll_GetSymbol(OpenGLModuleHandle,"wglDescribeLayerPlane"); - dwglSetLayerPaletteEntries = (wglSetLayerPaletteEntries_fp)dll_GetSymbol(OpenGLModuleHandle,"wglSetLayerPaletteEntries"); - dwglGetLayerPaletteEntries = (wglGetLayerPaletteEntries_fp)dll_GetSymbol(OpenGLModuleHandle,"wglGetLayerPaletteEntries"); - dwglRealizeLayerPalette = (wglRealizeLayerPalette_fp)dll_GetSymbol(OpenGLModuleHandle,"wglRealizeLayerPalette"); - dwglSwapLayerBuffers = (wglSwapLayerBuffers_fp)dll_GetSymbol(OpenGLModuleHandle,"wglSwapLayerBuffers"); - #if (WINVER >= 0x0500) - dwglSwapMultipleBuffers = (wglSwapMultipleBuffers_fp)dll_GetSymbol(OpenGLModuleHandle,"wglSwapMultipleBuffers"); - #endif -#endif - - } - - return true; -} - -void OpenGL_SetFuncsToNull(void) -{ - dglAccum = NULL; - dglAlphaFunc = NULL; - dglAreTexturesResident = NULL; - dglArrayElement = NULL; - dglBegin = NULL; - dglBindTexture = NULL; - dglBitmap = NULL; - dglBlendFunc = NULL; - dglCallList = NULL; - dglCallLists = NULL; - dglClear = NULL; - dglClearAccum = NULL; - dglClearColor = NULL; - dglClearDepth = NULL; - dglClearIndex = NULL; - dglClearStencil = NULL; - dglClipPlane = NULL; - dglColor3b = NULL; - dglColor3bv = NULL; - dglColor3d = NULL; - dglColor3dv = NULL; - dglColor3f = NULL; - dglColor3fv = NULL; - dglColor3i = NULL; - dglColor3iv = NULL; - dglColor3s = NULL; - dglColor3sv = NULL; - dglColor3ub = NULL; - dglColor3ubv = NULL; - dglColor3ui = NULL; - dglColor3uiv = NULL; - dglColor3us = NULL; - dglColor3usv = NULL; - dglColor4b = NULL; - dglColor4bv = NULL; - dglColor4d = NULL; - dglColor4dv = NULL; - dglColor4f = NULL; - dglColor4fv = NULL; - dglColor4i = NULL; - dglColor4iv = NULL; - dglColor4s = NULL; - dglColor4sv = NULL; - dglColor4ub = NULL; - dglColor4ubv = NULL; - dglColor4ui = NULL; - dglColor4uiv = NULL; - dglColor4us = NULL; - dglColor4usv = NULL; - dglColorMask = NULL; - dglColorMaterial = NULL; - dglColorPointer = NULL; - dglCopyPixels = NULL; - dglCopyTexImage1D = NULL; - dglCopyTexImage2D = NULL; - dglCopyTexSubImage1D = NULL; - dglCopyTexSubImage2D = NULL; - dglCullFace = NULL; - dglDeleteLists = NULL; - dglDeleteTextures = NULL; - dglDepthFunc = NULL; - dglDepthMask = NULL; - dglDepthRange = NULL; - dglDisable = NULL; - dglDisableClientState = NULL; - dglDrawArrays = NULL; - dglDrawBuffer = NULL; - dglDrawElements = NULL; - dglDrawPixels = NULL; - dglEdgeFlag = NULL; - dglEdgeFlagPointer = NULL; - dglEdgeFlagv = NULL; - dglEnable = NULL; - dglEnableClientState = NULL; - dglEnd = NULL; - dglEndList = NULL; - dglEvalCoord1d = NULL; - dglEvalCoord1dv = NULL; - dglEvalCoord1f = NULL; - dglEvalCoord1fv = NULL; - dglEvalCoord2d = NULL; - dglEvalCoord2dv = NULL; - dglEvalCoord2f = NULL; - dglEvalCoord2fv = NULL; - dglEvalMesh1 = NULL; - dglEvalMesh2 = NULL; - dglEvalPoint1 = NULL; - dglEvalPoint2 = NULL; - dglFeedbackBuffer = NULL; - dglFinish = NULL; - dglFlush = NULL; - dglFogf = NULL; - dglFogfv = NULL; - dglFogi = NULL; - dglFogiv = NULL; - dglFrontFace = NULL; - dglFrustum = NULL; - dglGenLists = NULL; - dglGenTextures = NULL; - dglGetBooleanv = NULL; - dglGetClipPlane = NULL; - dglGetDoublev = NULL; - dglGetError = NULL; - dglGetFloatv = NULL; - dglGetIntegerv = NULL; - dglGetLightfv = NULL; - dglGetLightiv = NULL; - dglGetMapdv = NULL; - dglGetMapfv = NULL; - dglGetMapiv = NULL; - dglGetMaterialfv = NULL; - dglGetMaterialiv = NULL; - dglGetPixelMapfv = NULL; - dglGetPixelMapuiv = NULL; - dglGetPixelMapusv = NULL; - dglGetPointerv = NULL; - dglGetPolygonStipple = NULL; - dglGetString = NULL; - dglGetTexEnvfv = NULL; - dglGetTexEnviv = NULL; - dglGetTexGendv = NULL; - dglGetTexGenfv = NULL; - dglGetTexGeniv = NULL; - dglGetTexImage = NULL; - dglGetTexLevelParameterfv = NULL; - dglGetTexLevelParameteriv = NULL; - dglGetTexParameterfv = NULL; - dglGetTexParameteriv = NULL; - dglHint = NULL; - dglIndexMask = NULL; - dglIndexPointer = NULL; - dglIndexd = NULL; - dglIndexdv = NULL; - dglIndexf = NULL; - dglIndexfv = NULL; - dglIndexi = NULL; - dglIndexiv = NULL; - dglIndexs = NULL; - dglIndexsv = NULL; - dglIndexub = NULL; - dglIndexubv = NULL; - dglInitNames = NULL; - dglInterleavedArrays = NULL; - dglIsEnabled = NULL; - dglIsList = NULL; - dglIsTexture = NULL; - dglLightModelf = NULL; - dglLightModelfv = NULL; - dglLightModeli = NULL; - dglLightModeliv = NULL; - dglLightf = NULL; - dglLightfv = NULL; - dglLighti = NULL; - dglLightiv = NULL; - dglLineStipple = NULL; - dglLineWidth = NULL; - dglListBase = NULL; - dglLoadIdentity = NULL; - dglLoadMatrixd = NULL; - dglLoadMatrixf = NULL; - dglLoadName = NULL; - dglLogicOp = NULL; - dglMap1d = NULL; - dglMap1f = NULL; - dglMap2d = NULL; - dglMap2f = NULL; - dglMapGrid1d = NULL; - dglMapGrid1f = NULL; - dglMapGrid2d = NULL; - dglMapGrid2f = NULL; - dglMaterialf = NULL; - dglMaterialfv = NULL; - dglMateriali = NULL; - dglMaterialiv = NULL; - dglMatrixMode = NULL; - dglMultMatrixd = NULL; - dglMultMatrixf = NULL; - dglNewList = NULL; - dglNormal3b = NULL; - dglNormal3bv = NULL; - dglNormal3d = NULL; - dglNormal3dv = NULL; - dglNormal3f = NULL; - dglNormal3fv = NULL; - dglNormal3i = NULL; - dglNormal3iv = NULL; - dglNormal3s = NULL; - dglNormal3sv = NULL; - dglNormalPointer = NULL; - dglOrtho = NULL; - dglPassThrough = NULL; - dglPixelMapfv = NULL; - dglPixelMapuiv = NULL; - dglPixelMapusv = NULL; - dglPixelStoref = NULL; - dglPixelStorei = NULL; - dglPixelTransferf = NULL; - dglPixelTransferi = NULL; - dglPixelZoom = NULL; - dglPointSize = NULL; - dglPolygonMode = NULL; - dglPolygonOffset = NULL; - dglPolygonStipple = NULL; - dglPopAttrib = NULL; - dglPopClientAttrib = NULL; - dglPopMatrix = NULL; - dglPopName = NULL; - dglPrioritizeTextures = NULL; - dglPushAttrib = NULL; - dglPushClientAttrib = NULL; - dglPushMatrix = NULL; - dglPushName = NULL; - dglRasterPos2d = NULL; - dglRasterPos2dv = NULL; - dglRasterPos2f = NULL; - dglRasterPos2fv = NULL; - dglRasterPos2i = NULL; - dglRasterPos2iv = NULL; - dglRasterPos2s = NULL; - dglRasterPos2sv = NULL; - dglRasterPos3d = NULL; - dglRasterPos3dv = NULL; - dglRasterPos3f = NULL; - dglRasterPos3fv = NULL; - dglRasterPos3i = NULL; - dglRasterPos3iv = NULL; - dglRasterPos3s = NULL; - dglRasterPos3sv = NULL; - dglRasterPos4d = NULL; - dglRasterPos4dv = NULL; - dglRasterPos4f = NULL; - dglRasterPos4fv = NULL; - dglRasterPos4i = NULL; - dglRasterPos4iv = NULL; - dglRasterPos4s = NULL; - dglRasterPos4sv = NULL; - dglReadBuffer = NULL; - dglReadPixels = NULL; - dglRectd = NULL; - dglRectdv = NULL; - dglRectf = NULL; - dglRectfv = NULL; - dglRecti = NULL; - dglRectiv = NULL; - dglRects = NULL; - dglRectsv = NULL; - dglRenderMode = NULL; - dglRotated = NULL; - dglRotatef = NULL; - dglScaled = NULL; - dglScalef = NULL; - dglScissor = NULL; - dglSelectBuffer = NULL; - dglShadeModel = NULL; - dglStencilFunc = NULL; - dglStencilMask = NULL; - dglStencilOp = NULL; - dglTexCoord1d = NULL; - dglTexCoord1dv = NULL; - dglTexCoord1f = NULL; - dglTexCoord1fv = NULL; - dglTexCoord1i = NULL; - dglTexCoord1iv = NULL; - dglTexCoord1s = NULL; - dglTexCoord1sv = NULL; - dglTexCoord2d = NULL; - dglTexCoord2dv = NULL; - dglTexCoord2f = NULL; - dglTexCoord2fv = NULL; - dglTexCoord2i = NULL; - dglTexCoord2iv = NULL; - dglTexCoord2s = NULL; - dglTexCoord2sv = NULL; - dglTexCoord3d = NULL; - dglTexCoord3dv = NULL; - dglTexCoord3f = NULL; - dglTexCoord3fv = NULL; - dglTexCoord3i = NULL; - dglTexCoord3iv = NULL; - dglTexCoord3s = NULL; - dglTexCoord3sv = NULL; - dglTexCoord4d = NULL; - dglTexCoord4dv = NULL; - dglTexCoord4f = NULL; - dglTexCoord4fv = NULL; - dglTexCoord4i = NULL; - dglTexCoord4iv = NULL; - dglTexCoord4s = NULL; - dglTexCoord4sv = NULL; - dglTexCoordPointer = NULL; - dglTexEnvf = NULL; - dglTexEnvfv = NULL; - dglTexEnvi = NULL; - dglTexEnviv = NULL; - dglTexGend = NULL; - dglTexGendv = NULL; - dglTexGenf = NULL; - dglTexGenfv = NULL; - dglTexGeni = NULL; - dglTexGeniv = NULL; - dglTexImage1D = NULL; - dglTexImage2D = NULL; - dglTexParameterf = NULL; - dglTexParameterfv = NULL; - dglTexParameteri = NULL; - dglTexParameteriv = NULL; - dglTexSubImage1D = NULL; - dglTexSubImage2D = NULL; - dglTranslated = NULL; - dglTranslatef = NULL; - dglVertex2d = NULL; - dglVertex2dv = NULL; - dglVertex2f = NULL; - dglVertex2fv = NULL; - dglVertex2i = NULL; - dglVertex2iv = NULL; - dglVertex2s = NULL; - dglVertex2sv = NULL; - dglVertex3d = NULL; - dglVertex3dv = NULL; - dglVertex3f = NULL; - dglVertex3fv = NULL; - dglVertex3i = NULL; - dglVertex3iv = NULL; - dglVertex3s = NULL; - dglVertex3sv = NULL; - dglVertex4d = NULL; - dglVertex4dv = NULL; - dglVertex4f = NULL; - dglVertex4fv = NULL; - dglVertex4i = NULL; - dglVertex4iv = NULL; - dglVertex4s = NULL; - dglVertex4sv = NULL; - dglVertexPointer = NULL; - dglViewport = NULL; - -#ifdef WIN32 - dwglCopyContext = NULL; - dwglCreateContext = NULL; - dwglCreateLayerContext = NULL; - dwglDeleteContext = NULL; - dwglGetCurrentContext = NULL; - dwglGetCurrentDC = NULL; - dwglGetProcAddress = NULL; - dwglMakeCurrent = NULL; - dwglShareLists = NULL; - dwglUseFontBitmapsA = NULL; - dwglUseFontBitmapsW = NULL; - dwglUseFontOutlinesA = NULL; - dwglUseFontOutlinesW = NULL; - dwglDescribeLayerPlane = NULL; - dwglSetLayerPaletteEntries = NULL; - dwglGetLayerPaletteEntries = NULL; - dwglRealizeLayerPalette = NULL; - dwglSwapLayerBuffers = NULL; - #if (WINVER >= 0x0500) - dwglSwapMultipleBuffers = NULL; - #endif -#endif - -} -#endif - - -#endif //!__LOADGL_H__ diff --git a/arch/ogl/include/ogl_init.h b/arch/ogl/include/ogl_init.h deleted file mode 100644 index e0ee68be..00000000 --- a/arch/ogl/include/ogl_init.h +++ /dev/null @@ -1,160 +0,0 @@ -//prototypes opengl functions - Added 9/15/99 Matthew Mueller -#ifndef _OGL_INIT_H_ -#define _OGL_INIT_H_ - -#ifdef __WINDOWS__ -#include -#include -#endif - -//#ifdef __WINDOWS__ -//#define OGL_RUNTIME_LOAD -//#endif - -#ifdef OGL_RUNTIME_LOAD -#include "loadgl.h" -int ogl_init_load_library(void); -#else -#include -#endif - -#ifndef GL_VERSION_1_1 -#ifdef GL_EXT_texture -#define GL_INTENSITY4 GL_INTENSITY4_EXT -#define GL_INTENSITY8 GL_INTENSITY8_EXT -#endif -#endif - - -#include "gr.h" -#include "palette.h" -#include "types.h" - - -#define OGL_TEXTURE_LIST_SIZE 2000 - -typedef struct _ogl_texture { - int handle; - GLint internalformat; - GLenum format; - int w,h,tw,th,lw; - int bytesu; - int bytes; - GLfloat u,v; - GLfloat prio; - int wrapstate; - fix lastrend; - ulong numrend; - char wantmip; -} ogl_texture; - -extern ogl_texture ogl_texture_list[OGL_TEXTURE_LIST_SIZE]; - -extern int ogl_mem_target; -ogl_texture* ogl_get_free_texture(void); -void ogl_init_texture(ogl_texture* t); -void ogl_init_texture_list_internal(void); -void ogl_smash_texture_list_internal(void); -void ogl_vivify_texture_list_internal(void); - -extern int ogl_fullscreen; -void ogl_do_fullscreen_internal(void); - -extern int ogl_voodoohack; - -extern int ogl_alttexmerge;//merge textures by just printing the seperate textures? -extern int ogl_rgba_format; -extern int ogl_intensity4_ok; -extern int ogl_luminance4_alpha4_ok; -extern int ogl_rgba2_ok; -extern int ogl_readpixels_ok; - -extern int gl_initialized; -extern int GL_texmagfilt,GL_texminfilt,GL_needmipmaps; -extern int gl_reticle; - -extern int GL_TEXTURE_2D_enabled; -//extern int GL_texclamp_enabled; -//extern int GL_TEXTURE_ENV_MODE_state,GL_TEXTURE_MAG_FILTER_state,GL_TEXTURE_MIN_FILTER_state; -#define OGL_ENABLE2(a,f) {if (a ## _enabled!=1) {f;a ## _enabled=1;}} -#define OGL_DISABLE2(a,f) {if (a ## _enabled!=0) {f;a ## _enabled=0;}} - -//#define OGL_ENABLE(a) OGL_ENABLE2(a,glEnable(a)) -//#define OGL_DISABLE(a) OGL_DISABLE2(a,glDisable(a)) -#define OGL_ENABLE(a) OGL_ENABLE2(GL_ ## a,glEnable(GL_ ## a)) -#define OGL_DISABLE(a) OGL_DISABLE2(GL_ ## a,glDisable(GL_ ## a)) - -//#define OGL_TEXCLAMP() OGL_ENABLE2(GL_texclamp,glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);) -//#define OGL_TEXREPEAT() OGL_DISABLE2(GL_texclamp,glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);) - -//#define OGL_SETSTATE(a,s,f) {if (a ## _state!=s) {f;a ## _state=s;}} - -//#define OGL_TEXENV(p,m) OGL_SETSTATE(p,m,glTexEnvi(GL_TEXTURE_ENV, p,m)); -//#define OGL_TEXPARAM(p,m) OGL_SETSTATE(p,m,glTexParameteri(GL_TEXTURE_2D,p,m)); - -extern int last_width,last_height; -#define OGL_VIEWPORT(x,y,w,h){if (w!=last_width || h!=last_height){glViewport(x,grd_curscreen->sc_canvas.cv_bitmap.bm_h-y-h,w,h);last_width=w;last_height=h;}} - -//platform specific funcs -//MSVC seems to have problems with inline funcs not being found during linking -#ifndef _MSC_VER -inline -#endif -void ogl_swap_buffers_internal(void); -int ogl_init_window(int x, int y);//create a window/switch modes/etc -void ogl_destroy_window(void);//destroy window/etc -void ogl_init(void);//one time initialization -void ogl_close(void);//one time shutdown - -//generic funcs -#define OGLTEXBUFSIZE (1024*1024*4) -extern GLubyte texbuf[OGLTEXBUFSIZE]; -//void ogl_filltexbuf(unsigned char *data,GLubyte *texp,int width,int height,int twidth,int theight); -void ogl_filltexbuf(unsigned char *data,GLubyte *texp,int truewidth,int width,int height,int dxo,int dyo,int twidth,int theight,int type); -void ogl_loadbmtexture_m(grs_bitmap *bm,int domipmap); -void ogl_loadbmtexture(grs_bitmap *bm); -//void ogl_loadtexture(unsigned char * data, int width, int height,int dxo,int dyo, int *texid,float *u,float *v,char domipmap,float prio); -void ogl_loadtexture(unsigned char * data, int dxo,int dyo, ogl_texture *tex); -void ogl_freetexture(ogl_texture *gltexture); -void ogl_freebmtexture(grs_bitmap *bm); -void ogl_do_palfx(void); -void ogl_start_frame(void); -void ogl_end_frame(void); -void ogl_swap_buffers(void); -void ogl_set_screen_mode(void); -void ogl_cache_level_textures(void); - -void ogl_urect(int left,int top,int right,int bot); -bool ogl_ubitmapm_c(int x, int y,grs_bitmap *bm,int c); -bool ogl_ubitmapm(int x, int y,grs_bitmap *bm); -bool ogl_ubitblt(int w,int h,int dx,int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest); -bool ogl_ubitblt_tolinear(int w,int h,int dx,int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest); -bool ogl_ubitblt_copy(int w,int h,int dx,int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest); -void ogl_upixelc(int x, int y, int c); -void ogl_ulinec(int left,int top,int right,int bot,int c); - -extern unsigned char *ogl_pal; - -#include "3d.h" -bool g3_draw_tmap_2(int nv,g3s_point **pointlist,g3s_uvl *uvl_list,grs_bitmap *bmbot,grs_bitmap *bm,int orient); - -void ogl_draw_reticle(int cross,int primary,int secondary); - -//whee -//#define PAL2Tr(c) ((gr_palette[c*3]+gr_palette_gamma)/63.0) -//#define PAL2Tg(c) ((gr_palette[c*3+1]+gr_palette_gamma)/63.0) -//#define PAL2Tb(c) ((gr_palette[c*3+2]+gr_palette_gamma)/63.0) -//#define PAL2Tr(c) ((gr_palette[c*3])/63.0) -//#define PAL2Tg(c) ((gr_palette[c*3+1])/63.0) -//#define PAL2Tb(c) ((gr_palette[c*3+2])/63.0) -#define CPAL2Tr(c) ((gr_current_pal[c*3])/63.0) -#define CPAL2Tg(c) ((gr_current_pal[c*3+1])/63.0) -#define CPAL2Tb(c) ((gr_current_pal[c*3+2])/63.0) -#define PAL2Tr(c) ((ogl_pal[c*3])/63.0) -#define PAL2Tg(c) ((ogl_pal[c*3+1])/63.0) -#define PAL2Tb(c) ((ogl_pal[c*3+2])/63.0) -//inline GLfloat PAL2Tr(int c); -//inline GLfloat PAL2Tg(int c); -//inline GLfloat PAL2Tb(int c); - -#endif diff --git a/arch/sdl/Makefile.am b/arch/sdl/Makefile.am deleted file mode 100644 index 23a16a3e..00000000 --- a/arch/sdl/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -noinst_LIBRARIES = libarchsdl.a -INCLUDES = -I $(top_srcdir)/includes -Iinclude -I $(top_srcdir)/main -I$(top_srcdir)/input/sdl/include - -libarchsdl_a_SOURCES = init.c timer.c diff --git a/arch/sdl/Makefile.in b/arch/sdl/Makefile.in deleted file mode 100644 index 5af03369..00000000 --- a/arch/sdl/Makefile.in +++ /dev/null @@ -1,299 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# 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. - -# 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. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = ../.. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CFLAGS = @CFLAGS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NASM = @NASM@ -NASMFLAGS = @NASMFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -SDL_LIBS = @SDL_LIBS@ -VERSION = @VERSION@ - -noinst_LIBRARIES = libarchsdl.a -INCLUDES = -I $(top_srcdir)/includes -Iinclude -I $(top_srcdir)/main -I$(top_srcdir)/input/sdl/include - -libarchsdl_a_SOURCES = init.c timer.c -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../../conf.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I../.. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -libarchsdl_a_LIBADD = -libarchsdl_a_OBJECTS = init.o timer.o -AR = ar -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -DEP_FILES = .deps/init.P .deps/timer.P -SOURCES = $(libarchsdl_a_SOURCES) -OBJECTS = $(libarchsdl_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu arch/sdl/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -.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: - -libarchsdl.a: $(libarchsdl_a_OBJECTS) $(libarchsdl_a_DEPENDENCIES) - -rm -f libarchsdl.a - $(AR) cru libarchsdl.a $(libarchsdl_a_OBJECTS) $(libarchsdl_a_LIBADD) - $(RANLIB) libarchsdl.a - -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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - 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 = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = arch/sdl - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu arch/sdl/Makefile - @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 - -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 - @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 -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -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-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-depend mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - 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-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags 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 \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -# 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/arch/sdl/init.c b/arch/sdl/init.c deleted file mode 100644 index 361d24ed..00000000 --- a/arch/sdl/init.c +++ /dev/null @@ -1,29 +0,0 @@ -// SDL architecture support -#include -#include -#include -#include -#include "text.h" -#include "event.h" -#include "error.h" -#include "args.h" - -extern void d_mouse_init(); - -void sdl_close() -{ - SDL_Quit(); -} - -void arch_sdl_init() -{ - // Initialise the library -//edited on 01/03/99 by Matt Mueller - if we use SDL_INIT_EVERYTHING, cdrom is initialized even if -nocdaudio is used -#ifdef SDL_INPUT - if (!args_find("-nomouse")) - d_mouse_init(); -#endif - if (!args_find("-nosound")) - digi_init(); - atexit(sdl_close); -} diff --git a/arch/sdl/timer.c b/arch/sdl/timer.c deleted file mode 100644 index 715bcb28..00000000 --- a/arch/sdl/timer.c +++ /dev/null @@ -1,13 +0,0 @@ -// SDL library timer functions - -#include -#include -#include "maths.h" - -fix timer_get_fixed_seconds(void) { - fix x; - unsigned long tv_now = SDL_GetTicks(); - x=i2f(tv_now/1000) | fixdiv(i2f(tv_now % 1000),i2f(1000)); - return x; -} - diff --git a/arch/sdl_init.c b/arch/sdl_init.c index 33c77794..e8f6b0ff 100644 --- a/arch/sdl_init.c +++ b/arch/sdl_init.c @@ -1,6 +1,18 @@ -// SDL architecture support +/* + * $Source: /cvs/cvsroot/d2x/arch/sdl_init.c,v $ + * $Revision: 1.4 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 13:35:09 $ + * + * SDL architecture support + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include -#ifdef __ENV_LINUX__ +#endif + #include #include #include @@ -8,6 +20,7 @@ #include "event.h" #include "error.h" #include "args.h" +#include "digi.h" extern void d_mouse_init(); @@ -21,12 +34,10 @@ void arch_sdl_init() // Initialise the library //edited on 01/03/99 by Matt Mueller - if we use SDL_INIT_EVERYTHING, cdrom is initialized even if -nocdaudio is used #ifdef SDL_INPUT - if (!args_find("-nomouse")) + if (!FindArg("-nomouse")) d_mouse_init(); #endif - if (!args_find("-nosound")) + if (!FindArg("-nosound")) digi_init(); atexit(sdl_close); } - -#endif // __ENV_LINUX__ diff --git a/arch/sdl_timer.c b/arch/sdl_timer.c index 44e9cf31..e11f3401 100644 --- a/arch/sdl_timer.c +++ b/arch/sdl_timer.c @@ -1,7 +1,18 @@ -// SDL library timer functions +/* + * $Source: /cvs/cvsroot/d2x/arch/sdl_timer.c,v $ + * $Revision: 1.2 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 13:35:09 $ + * + * SDL library timer functions + * + * $Log: not supported by cvs2svn $ + */ +#ifdef HAVE_CONFIG_H #include -#ifdef __ENV_LINUX__ +#endif + #include #include "maths.h" @@ -11,5 +22,3 @@ fix timer_get_fixed_seconds(void) { x=i2f(tv_now/1000) | fixdiv(i2f(tv_now % 1000),i2f(1000)); return x; } - -#endif diff --git a/arch/win32/Makefile.am b/arch/win32/Makefile.am new file mode 100644 index 00000000..a609f8ab --- /dev/null +++ b/arch/win32/Makefile.am @@ -0,0 +1,8 @@ +SUBDIRS = d3dframe include + +EXTRA_DIST = \ +d1x.ico d3d.ico descent.ico d1x.rc \ +ipx_drv.h \ +debug.cpp pch.cpp scene.cpp texture.cpp winmain.cpp \ +digi.c glinit.c gr.c hmpfile.c init.c ipx_win.c joydefs.c joyhh.c \ +key.c mono.c mouse.c palw32.c serial.c timer.c win32.c winnet.c diff --git a/arch/win32/d3dframe/Makefile.am b/arch/win32/d3dframe/Makefile.am new file mode 100644 index 00000000..25ada097 --- /dev/null +++ b/arch/win32/d3dframe/Makefile.am @@ -0,0 +1,5 @@ +EXTRA_DIST = \ +d3denum.h d3dframe.h d3dmath.h d3dtextr.h d3dutil.h \ +ddmm.h ddutil.h ddutil2.h dsutil.h lbprintf.h resource.h \ +d3denum.cpp d3dframe.cpp d3dmath.cpp d3dtextr.cpp d3dutil.cpp \ +ddenum.cpp userdlg.cpp diff --git a/arch/win32/include/Makefile.am b/arch/win32/include/Makefile.am new file mode 100644 index 00000000..bd8f6a03 --- /dev/null +++ b/arch/win32/include/Makefile.am @@ -0,0 +1,3 @@ +EXTRA_DIST = \ +d3dhelp.h debug.h hmpfile.h joy.h key.h mouse.h pch.h \ +resource.h scene.h serial.h texture.h winmain.h wsipx.h diff --git a/unused/win95/findfile.c b/arch/win32_findfile.c similarity index 93% rename from unused/win95/findfile.c rename to arch/win32_findfile.c index bf8a4004..3a4ec24b 100644 --- a/unused/win95/findfile.c +++ b/arch/win32_findfile.c @@ -11,12 +11,10 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif -#pragma off (unreferenced) -static char rcsid[] = "$Id: findfile.c,v 1.1.1.1 2001-01-19 03:30:15 bradleyb Exp $"; -#pragma on (unreferenced) - -#define _WIN32 #define WIN32_LEAN_AND_MEAN #include #include "findfile.h" diff --git a/autogen.sh b/autogen.sh index daf094af..07212a61 100644 --- a/autogen.sh +++ b/autogen.sh @@ -1,5 +1,8 @@ #!/bin/sh -aclocal +set -e +aclocal $ACLOCAL_FLAGS +autoheader automake --add-missing autoconf -./configure "$@" +#./configure "$@" +echo "Now you are ready to run ./configure" diff --git a/cfile/Makefile.am b/cfile/Makefile.am index e1e0391f..23440b3f 100644 --- a/cfile/Makefile.am +++ b/cfile/Makefile.am @@ -2,3 +2,6 @@ noinst_LIBRARIES = libcfile.a INCLUDES = -I $(top_srcdir)/includes libcfile_a_SOURCES = cfile.c + +EXTRA_DIST = \ +nocfile.h diff --git a/cfile/Makefile.in b/cfile/Makefile.in deleted file mode 100644 index 3c2d40dd..00000000 --- a/cfile/Makefile.in +++ /dev/null @@ -1,299 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# 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. - -# 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. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CFLAGS = @CFLAGS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NASM = @NASM@ -NASMFLAGS = @NASMFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -SDL_LIBS = @SDL_LIBS@ -VERSION = @VERSION@ - -noinst_LIBRARIES = libcfile.a -INCLUDES = -I $(top_srcdir)/includes - -libcfile_a_SOURCES = cfile.c -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../conf.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I.. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -libcfile_a_LIBADD = -libcfile_a_OBJECTS = cfile.o -AR = ar -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -DEP_FILES = .deps/cfile.P -SOURCES = $(libcfile_a_SOURCES) -OBJECTS = $(libcfile_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu cfile/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -.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: - -libcfile.a: $(libcfile_a_OBJECTS) $(libcfile_a_DEPENDENCIES) - -rm -f libcfile.a - $(AR) cru libcfile.a $(libcfile_a_OBJECTS) $(libcfile_a_LIBADD) - $(RANLIB) libcfile.a - -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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - 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 = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = cfile - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu cfile/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - 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 - @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 -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -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-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-depend mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - 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-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags 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 \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -# 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/cfile/cfile.c b/cfile/cfile.c index 3f59cf34..99df140f 100644 --- a/cfile/cfile.c +++ b/cfile/cfile.c @@ -11,7 +11,10 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H #include +#endif + #include #include diff --git a/conf.h.in b/conf.h.in index 70c4c9d6..a533786f 100644 --- a/conf.h.in +++ b/conf.h.in @@ -1,14 +1,8 @@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ - -/* Define if you need to in order for stat and other things to work. */ -#undef _POSIX_SOURCE +/* conf.h.in. Generated automatically from configure.in by autoheader. */ /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS -/* Define if you have netipx/ipx.h */ -#undef HAVE_NETIPX_IPX_H - /* Define if you want an assembler free build */ #undef NO_ASM @@ -18,27 +12,55 @@ /* Define if you want an OpenGL build */ #undef OGL +/* Define if you want an SVGALib build */ +#undef SVGA + +/* Define if you want a GGI build */ +#undef GGI + /* Define if building under linux */ #undef __ENV_LINUX__ /* Define if building under msdos */ #undef __ENV_DJGPP__ +/* Define to disable asserts, int3, etc. */ +#undef NDEBUG + +/* Define if you have the header file. */ +#undef HAVE_NETIPX_IPX_H + +/* Name of package */ +#undef PACKAGE + +/* Version number of package */ +#undef VERSION + + /* General defines */ #define NMONO 1 #define PIGGY_USE_PAGING 1 #define NEWDEMO 1 - #ifdef __ENV_LINUX__ +# define __SDL__ 1 # define SDL_AUDIO 1 # ifdef OGL -# define GLX_VIDEO 1 -# define GII_INPUT 1 -# define GII_XWIN 1 -# else -# define SDL_VIDEO 1 +# define SDL_GL_VIDEO 1 # define SDL_INPUT 1 +# else +# ifdef GGI +# define GGI_VIDEO 1 +# define GII_INPUT 1 +# else +# ifdef SVGA +# define SVGALIB_VIDEO 1 +# define SVGALIB_INPUT 1 +# else +# define SDL_VIDEO 1 +# define SDL_INPUT 1 +# endif +# endif # endif #endif diff --git a/configure b/configure deleted file mode 100644 index 683ade7a..00000000 --- a/configure +++ /dev/null @@ -1,2360 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help - --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer" -ac_help="$ac_help - --with-opengl Build OpenGL support " -ac_help="$ac_help - --without-assembler Do not use assembler optimization " -ac_help="$ac_help - --without-network Do not build network/serial support " - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -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' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -for ac_option -do - - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=main/game.c - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - - - - - -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:569: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:622: checking whether build environment is sane" >&5 -# Just in case -sleep 1 -echo timestamp > conftestfile -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "$*" != "X $srcdir/configure conftestfile" \ - && test "$*" != "X conftestfile $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - { echo "configure: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" 1>&2; exit 1; } - fi - - test "$2" = conftestfile - ) -then - # Ok. - : -else - { echo "configure: error: newly created file is older than distributed files! -Check your system clock" 1>&2; exit 1; } -fi -rm -f conftest* -echo "$ac_t""yes" 1>&6 -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed -fi -test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" - -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:679: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - -PACKAGE=d2x - -VERSION=0.0.9 - -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } -fi -cat >> confdefs.h <> confdefs.h <&6 -echo "configure:725: checking for working aclocal" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (aclocal --version) < /dev/null > /dev/null 2>&1; then - ACLOCAL=aclocal - echo "$ac_t""found" 1>&6 -else - ACLOCAL="$missing_dir/missing aclocal" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:738: checking for working autoconf" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoconf --version) < /dev/null > /dev/null 2>&1; then - AUTOCONF=autoconf - echo "$ac_t""found" 1>&6 -else - AUTOCONF="$missing_dir/missing autoconf" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:751: checking for working automake" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (automake --version) < /dev/null > /dev/null 2>&1; then - AUTOMAKE=automake - echo "$ac_t""found" 1>&6 -else - AUTOMAKE="$missing_dir/missing automake" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:764: checking for working autoheader" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoheader --version) < /dev/null > /dev/null 2>&1; then - AUTOHEADER=autoheader - echo "$ac_t""found" 1>&6 -else - AUTOHEADER="$missing_dir/missing autoheader" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:777: checking for working makeinfo" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (makeinfo --version) < /dev/null > /dev/null 2>&1; then - MAKEINFO=makeinfo - echo "$ac_t""found" 1>&6 -else - MAKEINFO="$missing_dir/missing makeinfo" - echo "$ac_t""missing" 1>&6 -fi - - - -echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:792: checking whether to enable maintainer-specific portions of Makefiles" >&5 - # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then - enableval="$enable_maintainer_mode" - USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no -fi - - echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 - - -if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - MAINT=$MAINTAINER_MODE_TRUE - - - -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:818: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:848: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:899: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:931: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 942 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:973: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:978: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1006: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi - -echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:1038: checking for POSIXized ISC" >&5 -if test -d /etc/conf/kconfig.d && - grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 -then - echo "$ac_t""yes" 1>&6 - ISC=yes # If later tests want to check for ISC. - cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - - if test "$GCC" = yes; then - CC="$CC -posix" - else - CC="$CC -Xp" - fi -else - echo "$ac_t""no" 1>&6 - ISC= -fi - -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1061: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1091: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1142: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1174: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 1185 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:1190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1216: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1221: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1249: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi - -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1283: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" -fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1311: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1332: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1349: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1366: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi - CPP="$ac_cv_prog_CPP" -else - ac_cv_prog_CPP="$CPP" -fi -echo "$ac_t""$CPP" 1>&6 - -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1391: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#include -#include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - ac_cv_header_stdc=yes -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then - : -else - cat > conftest.$ac_ext < -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } - -EOF -if { (eval echo configure:1471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - : -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no -fi -rm -fr conftest* -fi - -fi -fi - -echo "$ac_t""$ac_cv_header_stdc" 1>&6 -if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF -#define STDC_HEADERS 1 -EOF - -fi - - -echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1496: checking for Cygwin environment" >&5 -if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_cygwin=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_cygwin=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_cygwin" 1>&6 -CYGWIN= -test "$ac_cv_cygwin" = yes && CYGWIN=yes -echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1529: checking for mingw32 environment" >&5 -if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_mingw32=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_mingw32=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_mingw32" 1>&6 -MINGW32= -test "$ac_cv_mingw32" = yes && MINGW32=yes - -CFLAGS="-g -O2 -Wall" - -# Test for DJGPP -if test "$OSTYPE" = "MSDOS"; then - - CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS" - - -if test "$OSTYPE" = "MSDOS"; then - ENV_DJGPP_TRUE= - ENV_DJGPP_FALSE='#' -else - ENV_DJGPP_TRUE='#' - ENV_DJGPP_FALSE= -fi - cat >> confdefs.h <<\EOF -#define __ENV_DJGPP__ 1 -EOF - - # Extract the first word of "nasmw", so it can be a program name with args. -set dummy nasmw; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1580: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_NASM'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$NASM" in - /*) - ac_cv_path_NASM="$NASM" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_NASM="$NASM" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_NASM="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_NASM" && ac_cv_path_NASM="no" - ;; -esac -fi -NASM="$ac_cv_path_NASM" -if test -n "$NASM"; then - echo "$ac_t""$NASM" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - - -else - CFLAGS="-D_REENTRANT -pipe $CFLAGS" - - -if test "$OSTYPE" != "MSDOS"; then - ENV_LINUX_TRUE= - ENV_LINUX_FALSE='#' -else - ENV_LINUX_TRUE='#' - ENV_LINUX_FALSE= -fi - cat >> confdefs.h <<\EOF -#define __ENV_LINUX__ 1 -EOF - - - - echo $ac_n "checking for SDL_Init in -lSDL""... $ac_c" 1>&6 -echo "configure:1633: checking for SDL_Init in -lSDL" >&5 -ac_lib_var=`echo SDL'_'SDL_Init | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lSDL -ldl -lpthread $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SDL_LIBS="-lSDL" -else - echo "$ac_t""no" 1>&6 -{ echo "configure: error: The SDL which is required not found." 1>&2; exit 1; } -fi - - for ac_hdr in netipx/ipx.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1677: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1687: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 -fi -done - - - - - # Check for OpenGL - # Check whether --with-opengl or --without-opengl was given. -if test "${with_opengl+set}" = set; then - withval="$with_opengl" - case "${withval}" in - yes) opengl=true ;; - no) opengl=false ;; - *) { echo "configure: error: bad value ${withval} for --with-opengl" 1>&2; exit 1; } ;; - esac -else - opengl=false -fi - - - if test x$opengl = xtrue; then - echo $ac_n "checking for main in -lMesaGL""... $ac_c" 1>&6 -echo "configure:1732: checking for main in -lMesaGL" >&5 -ac_lib_var=`echo MesaGL'_'main | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lMesaGL -L/usr/X11R6/lib -lX11 -lXext -lm $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - OGL_LIBS="-lMesaGL" -else - echo "$ac_t""no" 1>&6 -{ echo "configure: error: MesaGL not found" 1>&2; exit 1; } - opengl=false -fi - - echo $ac_n "checking for main in -lMesaGLU""... $ac_c" 1>&6 -echo "configure:1770: checking for main in -lMesaGLU" >&5 -ac_lib_var=`echo MesaGLU'_'main | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lMesaGLU -lMesaGL -L/usr/X11R6/lib -lX11 -lXext -lm $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - OGL_LIBS="${OGL_LIBS} -lMesaGLU" -else - echo "$ac_t""no" 1>&6 -{ echo "configure: error: MesaGLU not found" 1>&2; exit 1; } - opengl=false -fi - - fi - - if test x$opengl = xtrue; then - cat >> confdefs.h <<\EOF -#define OGL 1 -EOF - - CFLAGS="-I \$(top_srcdir)/input/ggi/include $CFLAGS" - else - CFLAGS="-I \$(top_srcdir)/input/sdl/include $CFLAGS" - fi - - -if test x$opengl = xtrue; then - USE_OPENGL_TRUE= - USE_OPENGL_FALSE='#' -else - USE_OPENGL_TRUE='#' - USE_OPENGL_FALSE= -fi - - # Extract the first word of "nasm", so it can be a program name with args. -set dummy nasm; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1831: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_NASM'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$NASM" in - /*) - ac_cv_path_NASM="$NASM" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_NASM="$NASM" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_NASM="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_NASM" && ac_cv_path_NASM="no" - ;; -esac -fi -NASM="$ac_cv_path_NASM" -if test -n "$NASM"; then - echo "$ac_t""$NASM" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - CFLAGS="-I \$(top_srcdir)/input/linux/include -I \$(top_srcdir)/arch/linux/include $CFLAGS" - -fi - -# Check for NASM and network -NO_ASM=0 -NO_NETWORK=0 -# Check whether --with-assembler or --without-assembler was given. -if test "${with_assembler+set}" = set; then - withval="$with_assembler" - if test x$withval = xno; then - NO_ASM=1 - fi -fi - -# Check whether --with-network or --without-network was given. -if test "${with_network+set}" = set; then - withval="$with_network" - if test x$withval = xno; then - NO_NETWORK=1 - fi -fi - - -if test "$NASM" = "no"; then - NO_ASM=1 -fi -if test "$NO_ASM" = 1; then - cat >> confdefs.h <<\EOF -#define NO_ASM 1 -EOF - - NASMFLAGS="" -else - case $ARCH in - win32) - NASMFLAGS="-f win32" - ;; - *) - if test "$OSTYPE" = "MSDOS"; then - NASMFLAGS="-f coff" - else - NASMFLAGS="-f elf -d__ENV_LINUX__" - fi - ;; - esac -fi -if test "$NO_NETWORK" = 0; then - cat >> confdefs.h <<\EOF -#define NETWORK 1 -EOF - -fi - - -if test "$NO_ASM" != 1; then - USE_ASM_TRUE= - USE_ASM_FALSE='#' -else - USE_ASM_TRUE='#' - USE_ASM_FALSE= -fi - - - - -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed -fi -test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" - -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," - - -#libdir='$(shell pwd)/${top_srcdir}/main' -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -DEFS=-DHAVE_CONFIG_H - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS </dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" - -trap 'rm -fr `echo "Makefile -2d/Makefile -3d/Makefile -maths/Makefile -mem/Makefile -cfile/Makefile -iff/Makefile -texmap/Makefile -misc/Makefile -input/Makefile -video/Makefile -sound/Makefile -arch/Makefile -main/Makefile - conf.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@PACKAGE@%$PACKAGE%g -s%@VERSION@%$VERSION%g -s%@ACLOCAL@%$ACLOCAL%g -s%@AUTOCONF@%$AUTOCONF%g -s%@AUTOMAKE@%$AUTOMAKE%g -s%@AUTOHEADER@%$AUTOHEADER%g -s%@MAKEINFO@%$MAKEINFO%g -s%@SET_MAKE@%$SET_MAKE%g -s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g -s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g -s%@MAINT@%$MAINT%g -s%@CC@%$CC%g -s%@RANLIB@%$RANLIB%g -s%@CPP@%$CPP%g -s%@ENV_DJGPP_TRUE@%$ENV_DJGPP_TRUE%g -s%@ENV_DJGPP_FALSE@%$ENV_DJGPP_FALSE%g -s%@NASM@%$NASM%g -s%@ENV_LINUX_TRUE@%$ENV_LINUX_TRUE%g -s%@ENV_LINUX_FALSE@%$ENV_LINUX_FALSE%g -s%@SDL_LIBS@%$SDL_LIBS%g -s%@USE_OPENGL_TRUE@%$USE_OPENGL_TRUE%g -s%@USE_OPENGL_FALSE@%$USE_OPENGL_FALSE%g -s%@USE_ASM_TRUE@%$USE_ASM_TRUE%g -s%@USE_ASM_FALSE@%$USE_ASM_FALSE%g -s%@NASMFLAGS@%$NASMFLAGS%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' -ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr - -# This sed command replaces #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. - -rm -f conftest.tail -while : -do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS - echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - fi - rm -f $ac_file - mv conftest.h $ac_file - fi -fi; done - -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - - diff --git a/configure.in b/configure.in index daeb1a3c..e3f36f1f 100644 --- a/configure.in +++ b/configure.in @@ -1,40 +1,88 @@ -AC_INIT(main/game.c) +# -*- mode: shell-script -*- +AC_INIT(main/inferno.c) + +AC_VALIDATE_CACHED_SYSTEM_TUPLE( + rm $cache_file + echo restart configure + exit 1 +) AM_CONFIG_HEADER(conf.h) -AM_INIT_AUTOMAKE(d2x, 0.0.9) +AM_INIT_AUTOMAKE(d2x, 0.1.0) AM_MAINTAINER_MODE +AC_PROG_INSTALL +AC_CHECK_TOOL(CC, gcc, :) AC_ISC_POSIX -AC_PROG_CC -AC_PROG_RANLIB +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(AR, ar, :) AC_STDC_HEADERS +NO_ASM=0 +NO_NETWORK=0 +GL_LIBS="GL GLU" + AC_CYGWIN +if test x$CYGWIN = xyes; then + AC_MSG_WARN([Cygwin found, setting -mno-cygwin]) + CFLAGS="$CFLAGS -mno-cygwin" +fi + AC_MINGW32 +AM_CONDITIONAL(MINGW32, test x$MINGW32 = xyes) +if test x$MINGW32 = xyes; then + GL_LIBS="opengl32 glu32" + AC_MSG_WARN([mingw32 found, disabling network and assembler]) + NO_ASM=1 + NO_NETWORK=1 +fi + +CFLAGS="$CFLAGS -g -O2 -Wall" -CFLAGS="-g -O2 -Wall" +dnl Count warnings as errors? +AC_ARG_WITH(werror, + [ --with-werror Count compiler warning as errors ], + [case "${withval}" in + yes) CFLAGS="-Werror $CFLAGS" ;; + no) ;; + *) AC_MSG_ERROR(bad value ${withval} for --with-werror) ;; + esac],) + +dnl Build with NDEBUG? +AC_ARG_WITH(ndebug, + [ --with-ndebug Take out extra Asserts, Int3, etc ], + [case "${withval}" in + yes) AC_DEFINE(NDEBUG) ;; + no) ;; + *) AC_MSG_ERROR(bad value ${withval} for --with-ndebug) ;; + esac],) # Test for DJGPP -if test "$OSTYPE" = "MSDOS"; then +AM_CONDITIONAL(ENV_DJGPP, test "$host_os" = "msdosdjgpp") +if test "$host_os" = "msdosdjgpp"; then CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS" - AM_CONDITIONAL(ENV_DJGPP, test "$OSTYPE" = "MSDOS") AC_DEFINE(__ENV_DJGPP__) - AC_PATH_PROG(NASM, nasmw, no) - + AC_PATH_PROG(NASM, nasm, no) + TARGETS=d2x else - CFLAGS="-D_REENTRANT -pipe $CFLAGS" - AM_CONDITIONAL(ENV_LINUX, test "$OSTYPE" != "MSDOS") - AC_DEFINE(__ENV_LINUX__) + CFLAGS="-pipe $CFLAGS" + case "$host_os" in + *linux*) AC_DEFINE(__ENV_LINUX__) ;; + esac - AC_CHECK_LIB(SDL, SDL_Init, SDL_LIBS="-lSDL", AC_MSG_ERROR(The SDL which is required not found.),-ldl -lpthread) - AC_CHECK_HEADERS(netipx/ipx.h) + dnl Check for SDL + AM_PATH_SDL(1.1.7, + :, + AC_MSG_ERROR(SDL not found. Make sure sdl-config is in your PATH, or specify with --with-sdl-prefix) + ) AC_SUBST(SDL_LIBS) - + AC_CHECK_HEADERS(netipx/ipx.h) + # Check for OpenGL AC_ARG_WITH(opengl, [ --with-opengl Build OpenGL support ], @@ -43,36 +91,89 @@ else no) opengl=false ;; *) AC_MSG_ERROR(bad value ${withval} for --with-opengl) ;; esac],[opengl=false]) - + if test x$opengl = xtrue; then - AC_CHECK_LIB(MesaGL, main, - OGL_LIBS="-lMesaGL", - [AC_MSG_ERROR(MesaGL not found, OpenGL cannot be built) - opengl=false], - -L/usr/X11R6/lib -lX11 -lXext -lm) - AC_CHECK_LIB(MesaGLU,main, - OGL_LIBS="${OGL_LIBS} -lMesaGLU", - [AC_MSG_ERROR(MesaGLU not found, OpenGL cannot be built) - opengl=false], - -lMesaGL -L/usr/X11R6/lib -lX11 -lXext -lm) + for lib in $GL_LIBS; do + AC_CHECK_LIB($lib, main, + OGL_LIBS="${OGL_LIBS} -l$lib", + [AC_MSG_ERROR([$lib not found, --with-opengl cannot be used]) + opengl=false], + ${OGL_LIBS} + ) + done + fi + AC_SUBST(OGL_LIBS) + AM_CONDITIONAL(USE_OPENGL, test x$opengl = xtrue) + + CFLAGS="$SDL_CFLAGS $CFLAGS" + + # Check for GGI + AC_ARG_WITH(ggi, + [ --with-ggi Build GGI support ], + [case "${withval}" in + yes) ggi=true ;; + no) ggi=false ;; + *) AC_MSG_ERROR(bad value ${withval} for --with-ggi) ;; + esac],[ggi=false]) + + if test x$ggi = xtrue; then + AC_CHECK_LIB(ggi, ggiInit, + GGI_LIBS="-lggi", + [AC_MSG_ERROR([GGI not found, GGI version cannot be built]); ggi=false]) + AC_CHECK_LIB(gii, giiInit, + GGI_LIBS="${GGI_LIBS} -lgii", + [AC_MSG_ERROR([GII not found, GGI version cannot be built]); ggi=false]) fi + AC_SUBST(GGI_LIBS) + AM_CONDITIONAL(USE_GGI, test x$ggi = xtrue) + + # Check for SVGALib + AC_ARG_WITH(svga, + [ --with-svga Build SVGALib support ], + [case "${withval}" in + yes) svga=true ;; + no) svga=false ;; + *) AC_MSG_ERROR(bad value ${withval} for --with-svga) ;; + esac],[svga=false]) + + if test x$svga = xtrue; then + AC_CHECK_LIB(vga, vga_getmousetype, + SVGA_LIBS="-lvga", + [AC_MSG_ERROR([vga not found, SVGALib cannot be built]) + svga=false], + ) + AC_CHECK_LIB(vgagl,gl_getcontext, + SVGA_LIBS="${SVGA_LIBS} -lvgagl", + [AC_MSG_ERROR([vgagl not found, SVGALib cannot be built]) + svga=false], + -lvga) + fi + AC_SUBST(SVGA_LIBS) + AM_CONDITIONAL(USE_SVGALIB, test x$svga = xtrue) if test x$opengl = xtrue; then AC_DEFINE(OGL) - CFLAGS="-I \$(top_srcdir)/input/ggi/include $CFLAGS" + TARGETS=d2x-ogl else - CFLAGS="-I \$(top_srcdir)/input/sdl/include $CFLAGS" + if test x$svga = xtrue; then + AC_DEFINE(SVGA) + TARGETS=d2x-svga + else + if test x$ggi = xtrue; then + AC_DEFINE(GGI) + TARGETS=d2x-ggi + else + TARGETS=d2x-sdl + fi + fi fi - AM_CONDITIONAL(USE_OPENGL, test x$opengl = xtrue) AC_PATH_PROG(NASM, nasm, no) - CFLAGS="-I \$(top_srcdir)/input/linux/include -I \$(top_srcdir)/arch/linux/include $CFLAGS" + CFLAGS="-I\$(top_srcdir)/input/linux/include -I\$(top_srcdir)/arch/linux/include $CFLAGS" fi # Check for NASM and network -NO_ASM=0 -NO_NETWORK=0 AC_ARG_WITH(assembler, [ --without-assembler Do not use assembler optimization ], if test x$withval = xno; then @@ -91,27 +192,32 @@ if test "$NO_ASM" = 1; then AC_DEFINE(NO_ASM) NASMFLAGS="" else - case $ARCH in - win32) - NASMFLAGS="-f win32" + case $host_os in + cygwin) + NASMFLAGS="-f win32 -i\$(srcdir)/" ;; - *) - if test "$OSTYPE" = "MSDOS"; then - NASMFLAGS="-f coff" - else - NASMFLAGS="-f elf -d__ENV_LINUX__" - fi + msdosdjgpp) + NASMFLAGS="-f coff -i\$(srcdir)/" + ;; + linux*) + NASMFLAGS="-f elf -d__ENV_LINUX__ -i\$(srcdir)/" ;; + *) + AC_MSG_ERROR([Assembler not supported for this OS]) esac fi if test "$NO_NETWORK" = 0; then AC_DEFINE(NETWORK) fi AM_CONDITIONAL(USE_ASM, test "$NO_ASM" != 1) +AM_CONDITIONAL(USE_NETWORK, test "$NO_NETWORK" != 1) + AC_SUBST(NASMFLAGS) AC_SUBST(CFLAGS) +AC_SUBST(TARGETS) + AC_ARG_PROGRAM #libdir='$(shell pwd)/${top_srcdir}/main' @@ -119,16 +225,48 @@ AC_OUTPUT( Makefile 2d/Makefile 3d/Makefile -maths/Makefile -mem/Makefile +arch/Makefile +arch/dos/Makefile +arch/dos/allg_snd/Makefile +arch/dos/allg_snd/sound/Makefile +arch/dos/allg_snd/sound/drv/Makefile +arch/dos/bak/Makefile +arch/dos/comm/Makefile +arch/dos/comm/include/Makefile +arch/dos/include/Makefile +arch/dos/mm_snd/Makefile +arch/dos/mm_snd/include/Makefile +arch/include/Makefile +arch/linux/Makefile +arch/linux/include/Makefile +arch/win32/Makefile +arch/win32/d3dframe/Makefile +arch/win32/include/Makefile cfile/Makefile iff/Makefile -texmap/Makefile -misc/Makefile +iff/archive/Makefile +includes/Makefile input/Makefile -video/Makefile -sound/Makefile -arch/Makefile +input/linux/Makefile +input/linux/include/Makefile main/Makefile -) - +main/editor/Makefile +main/old/Makefile +maths/Makefile +mem/Makefile +misc/Makefile +sound/Makefile +texmap/Makefile +unused/Makefile +unused/bios/Makefile +unused/lib/Makefile +unused/novga/Makefile +unused/pa_null/Makefile +unused/ui/Makefile +unused/vga/Makefile +unused/vga/new/Makefile +unused/win95/Makefile +video/Makefile +tools/Makefile +tools/cvs2cl/Makefile +) \ No newline at end of file diff --git a/copying b/copying deleted file mode 100644 index b23848af..00000000 --- a/copying +++ /dev/null @@ -1,21 +0,0 @@ -Original Descent 2 code license: - -THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. - -We make no warranties as to the usability or correctness of this code. - -Additional restrictions: -Any executable created using files or code taken from this source tree -MUST be open source. By using this source, you are agreeing to this -term, in the interest of the descent and descent programming -communities. The only exception is if the writer of the original -source gives explicit permission for the code to be used otherwise. diff --git a/cvshowto.txt b/cvshowto.txt new file mode 100644 index 00000000..32f0dc64 --- /dev/null +++ b/cvshowto.txt @@ -0,0 +1,74 @@ +Adapted from the d1x cvs howto +by Bradley Bell + +A quick howto on accessing the d2x source with CVS. + +0) if you are using windows, or some other non unix os, and the standard + command line cvs client, you will need to set your home directory. + set home=c:\home\ + or something like that. + +1) cd + +1.5) cvs -d ":pserver:@shelob.classrooms.washington.edu:/var/cvs" login + Unless you already know your username and password, you want + "anonymous" for the username, and "readonly" for the password. + +2) cvs -d ":pserver:@shelob.classrooms.washington.edu:/var/cvs" checkout d2x + This will retrieve the source into /d2x + (you may wish to look into the -z flag, ex "-z3" to compress the code for + faster transmission) + (note that this should only be done once. After you already have the code, + merely do a "cvs update -PAd" from the d2x dir to update to the latest code) + +3) Make your changes and stuff. (Test them too). + +4) You will want to do a cvs update before commiting, to make sure your + changes still work with any other changes that may have been commited while + you were working. + +5) If you have readonly access: + If you have only modified existing files, this should generate a usable diff: + cvs -q diff -uRN . > mychanges.patch + (hopefully you would use a more useful name, and remember to examine the + result first, to make sure its ok.) + If you have added files or directories, this won't be as useful since you + can't use the 'cvs add' command to get cvs to recognize them. In this case + you should diff manually, or just zip up the new files. + + Once you have the patches/zips made, the best way to get them included is to + post a message to the descent-source list with the files attached, or an url + to the files. (see notes below) + +-or- if you have full cvs access: + + cvs commit -m "summary of changes" + or, if you want to commit all changes (in current, and sub dirs), just: + cvs commit -m "summary of changes" + (note, only the files that CVS knows about will be commited. *.o/*.bak/etc + will be ignored. If you want to add a new file, use 'cvs add ') + If you have made several unrelated changes, please commit each file seperatly + with appropriate log messages, rather than blanketing them all in an + ambiguous message. + +6) Now that you have the source downloaded, you no longer need steps 1-2. + Merely do a "cvs update" whenever you want to bring your tree up to the + latest code, and continue from step 3. + +Notes: +It is highly recommend that all developers subscribe to the descent-source +mailing list. To signup, send an email to majordomo@warpcore.org with +"subscribe descent-source your@email.address" in the body. + +If some of your changes are too close to other peoples, update or commit may +cause a "conflict". You should probably talk with whoevers code it conflicts +with, unless the solution is obvious. + +Of course, this is only a brief overview. It is recommended you browse the CVS +documention as well. (info cvs, or equivilant). If you have questions, or +think this howto could use some clarification, feel free to ask. + + A great book on cvs is available online: + http://cvsbook.red-bean.com/cvsbook.html + +Where to download CVS: http://www.cyclic.com/cyclic-pages/howget.html diff --git a/cygconf b/cygconf new file mode 100644 index 00000000..77119466 --- /dev/null +++ b/cygconf @@ -0,0 +1,2 @@ +export ACLOCAL_FLAGS="-I /usr/local/cross-tools/i386-mingw32msvc/share/aclocal" +export PATH=$PATH:/usr/local/cross-tools/i386-mingw32msvc/bin diff --git a/iff/Makefile.am b/iff/Makefile.am index ebed0a87..01f40f24 100644 --- a/iff/Makefile.am +++ b/iff/Makefile.am @@ -1,3 +1,5 @@ +SUBDIRS = archive + noinst_LIBRARIES = libiff.a INCLUDES = -I $(top_srcdir)/includes diff --git a/iff/Makefile.in b/iff/Makefile.in deleted file mode 100644 index 8a3b3334..00000000 --- a/iff/Makefile.in +++ /dev/null @@ -1,299 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# 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. - -# 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. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CFLAGS = @CFLAGS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NASM = @NASM@ -NASMFLAGS = @NASMFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -SDL_LIBS = @SDL_LIBS@ -VERSION = @VERSION@ - -noinst_LIBRARIES = libiff.a -INCLUDES = -I $(top_srcdir)/includes - -libiff_a_SOURCES = iff.c -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../conf.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I.. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -libiff_a_LIBADD = -libiff_a_OBJECTS = iff.o -AR = ar -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -DEP_FILES = .deps/iff.P -SOURCES = $(libiff_a_SOURCES) -OBJECTS = $(libiff_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu iff/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -.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: - -libiff.a: $(libiff_a_OBJECTS) $(libiff_a_DEPENDENCIES) - -rm -f libiff.a - $(AR) cru libiff.a $(libiff_a_OBJECTS) $(libiff_a_LIBADD) - $(RANLIB) libiff.a - -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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - 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 = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = iff - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu iff/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - 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 - @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 -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -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-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-depend mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - 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-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags 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 \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -# 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/iff/archive/Makefile.am b/iff/archive/Makefile.am new file mode 100644 index 00000000..f11f43c5 --- /dev/null +++ b/iff/archive/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ +iff15bpp.c iff8bpp.c iffmike.c ifftest.c ifftestv.c diff --git a/iff/iff.c b/iff/iff.c index f67f362e..1169b2d2 100644 --- a/iff/iff.c +++ b/iff/iff.c @@ -11,11 +11,13 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ -#ifdef RCS -static char rcsid[] = "$Id: iff.c,v 1.1.1.1 2001-01-19 03:29:58 bradleyb Exp $"; +#ifdef HAVE_CONFIG_H +#include #endif -#include +#ifdef RCS +static char rcsid[] = "$Id: iff.c,v 1.4 2001-01-31 15:17:48 bradleyb Exp $"; +#endif #define COMPRESS 1 //do the RLE or not? (for debugging mostly) #define WRITE_TINY 0 //should we write a TINY chunk? @@ -273,7 +275,12 @@ int parse_body(FFILE *ifile,long len,iff_bitmap_header *bmheader) char ignore=0; unsigned char *data_end; int end_pos; + #ifndef NDEBUG int row_count=0; + #endif + + width=0; + depth=0; end_pos = ifile->position + len; if (len&1) @@ -912,6 +919,8 @@ int rle_span(ubyte *dest,ubyte *src,int len) int n,lit_cnt,rep_cnt; ubyte last,*cnt_ptr,*dptr; + cnt_ptr=0; + dptr = dest; last=src[0]; lit_cnt=1; diff --git a/include/3d.h b/include/3d.h index 34bfe28a..8561bf2e 100644 --- a/include/3d.h +++ b/include/3d.h @@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/include/3d.h,v $ - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:30:16 $ + * $Date: 2001-01-20 13:49:14 $ * * Header file for 3d library * * $Log: not supported by cvs2svn $ + * Revision 1.1.1.1 2001/01/19 03:30:16 bradleyb + * Import of d2x-0.0.8 + * * Revision 1.1.1.1 1999/06/14 22:02:03 donut * Import of d1x 1.37 source. * @@ -35,6 +38,8 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #ifndef _3D_H #define _3D_H +#include "vecmat.h" + extern int g3d_interp_outline; //if on, polygon models outlined in white extern vms_vector Matrix_scale; extern short highest_texture_num; diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 00000000..95c3d01d --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1,10 @@ +EXTRA_DIST = \ +d.bat lst.bat m.bat \ +test.lnk \ +dtypes.inc psmacros.inc pstypes.inc \ +3d.h args.h byteswap.h cfile.h checker.h cmd.h console.h \ +d_delay.h d_io.h dtypes.h error.h findfile.h fix.h gr.h grdef.h \ +hash.h ibitblt.h iff.h ipx.h loadgl.h maths.h modex.h mono.h \ +ogl_init.h pa_enabl.h palette.h pcx.h pstypes.h rle.h strio.h \ +strutil.h texmap.h timer.h u_dpmi.h u_mem.h vecmat.h vesa.h \ +test.c diff --git a/include/args.h b/include/args.h index 19c27302..307c8fdb 100644 --- a/include/args.h +++ b/include/args.h @@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/include/args.h,v $ - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:30:16 $ + * $Date: 2001-01-24 04:29:45 $ * * Prototypes for accessing arguments. * * $Log: not supported by cvs2svn $ + * Revision 1.1.1.1 2001/01/19 03:30:16 bradleyb + * Import of d2x-0.0.8 + * * Revision 1.1.1.1 1999/06/14 22:02:08 donut * Import of d1x 1.37 source. * @@ -49,7 +52,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. extern int Num_args; extern char * Args[]; -extern int args_find( char * s ); +extern int FindArg( char * s ); extern void args_init( int argc, char **argv ); #endif diff --git a/include/console.h b/include/console.h index a9bec931..57279cbe 100644 --- a/include/console.h +++ b/include/console.h @@ -3,6 +3,8 @@ #ifndef _CONSOLE_H_ #define _CONSOLE_H_ 1 +#include "pstypes.h" + /* Priority levels */ #define CON_CRITICAL -2 #define CON_URGENT -1 @@ -40,7 +42,7 @@ float cvar(char *cvar_name); /* Console CVars */ /* How discriminating we are about which messages are displayed */ -cvar_t con_threshold; +extern cvar_t con_threshold; #endif /* _CONSOLE_H_ */ diff --git a/include/d_delay.h b/include/d_delay.h index ce519dc9..fda286c1 100644 --- a/include/d_delay.h +++ b/include/d_delay.h @@ -3,11 +3,6 @@ #ifndef _D_DELAY #define _D_DELAY -//#ifdef __LINUX__ - void d_delay (int ms); -/*#else -#include -#define d_delay delay -#endif - */ +void d_delay (int ms); + #endif diff --git a/include/d_io.h b/include/d_io.h index 6c749ebf..e8f9a1cf 100644 --- a/include/d_io.h +++ b/include/d_io.h @@ -15,4 +15,6 @@ unsigned long d_getdiskfree(); // remove extension from filename, doesn't work with paths. void removeext(const char *filename, char *out); +unsigned long GetDiskFree(); + #endif diff --git a/include/error.h b/include/error.h index b3ee671a..31e86c27 100644 --- a/include/error.h +++ b/include/error.h @@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/include/error.h,v $ - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:30:16 $ + * $Date: 2001-01-22 15:49:14 $ * * Header for error handling/printing/exiting code * * $Log: not supported by cvs2svn $ + * Revision 1.1.1.1 2001/01/19 03:30:16 bradleyb + * Import of d2x-0.0.8 + * * Revision 1.3 1999/10/14 04:48:21 donut * alpha fixes, and gl_font args * @@ -69,6 +72,11 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifndef _ERROR_H +#define _ERROR_H + +#include + #ifdef __GNUC__ #define __noreturn __attribute__ ((noreturn)) #define __format __attribute__ ((format (printf, 1, 2))) @@ -144,3 +152,5 @@ void Int3(void); //generate int3 #define Int3() ((void)0) //void Int3(); #endif + +#endif /* _ERROR_H */ diff --git a/include/gr.h b/include/gr.h index 269874cc..bafc214a 100644 --- a/include/gr.h +++ b/include/gr.h @@ -462,6 +462,24 @@ extern void gr_merge_textures_3( ubyte * lower, ubyte * upper, ubyte * dest ); extern void gr_update(void); -#endif +/* + * currently SDL and OGL are the only things that supports toggling + * fullscreen. otherwise add other checks to the #if -MPM + */ +#if (defined(SDL_VIDEO) || defined(OGL)) +#define GR_SUPPORTS_FULLSCREEN_TOGGLE + +/* + * must return 0 if windowed, 1 if fullscreen + */ +int gr_check_fullscreen(void); +/* + * returns state after toggling (ie, same as if you had called + * check_fullscreen immediatly after) + */ +int gr_toggle_fullscreen(void); + +#endif +#endif diff --git a/include/loadgl.h b/include/loadgl.h index 40361dd8..1146f959 100644 --- a/include/loadgl.h +++ b/include/loadgl.h @@ -1144,7 +1144,7 @@ void *dll_GetSymbol(void *dllhandle,const char *symname) return (void *)GetProcAddress((HINSTANCE)dllhandle,symname); } #endif -#ifdef __LINUX__ +#ifdef __ENV_LINUX__ #include void *dll_LoadModule(const char *name) { diff --git a/include/modex.h b/include/modex.h index 4327e376..0092cde6 100644 --- a/include/modex.h +++ b/include/modex.h @@ -5,6 +5,7 @@ extern void gr_modex_setplane(short plane); extern void gr_modex_setstart(short x, short y, int wait_for_retrace); extern void gr_modex_uscanline( short x1, short x2, short y, unsigned char color ); extern void gr_modex_line(); +extern void gr_sync_display(); extern int modex_line_vertincr; extern int modex_line_incr1; diff --git a/include/mono.h b/include/mono.h index 33d12d96..c899c14d 100644 --- a/include/mono.h +++ b/include/mono.h @@ -14,6 +14,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #ifndef _MONO_H #define _MONO_H +#include #include #include "console.h" diff --git a/include/ogl_init.h b/include/ogl_init.h index 5d7cf37a..c4a2df64 100644 --- a/include/ogl_init.h +++ b/include/ogl_init.h @@ -16,6 +16,9 @@ int ogl_init_load_library(void); #else #include +//######hack, since multi texture support is not working +#undef GL_ARB_multitexture +#undef GL_SGIS_multitexture #endif #ifndef GL_VERSION_1_1 @@ -68,6 +71,17 @@ extern int ogl_intensity4_ok; extern int ogl_luminance4_alpha4_ok; extern int ogl_rgba2_ok; extern int ogl_readpixels_ok; +extern int ogl_gettexlevelparam_ok; +#ifdef GL_ARB_multitexture +extern int ogl_arb_multitexture_ok; +#else +#define ogl_arb_multitexture_ok 0 +#endif +#ifdef GL_SGIS_multitexture +extern int ogl_sgis_multitexture_ok; +#else +#define ogl_sgis_multitexture_ok 0 +#endif extern int gl_initialized; extern int GL_texmagfilt,GL_texminfilt,GL_needmipmaps; @@ -107,7 +121,8 @@ void ogl_init(void);//one time initialization void ogl_close(void);//one time shutdown //generic funcs -#define OGLTEXBUFSIZE (1024*1024*4) +//#define OGLTEXBUFSIZE (1024*1024*4) +#define OGLTEXBUFSIZE (2048*2048*4) extern GLubyte texbuf[OGLTEXBUFSIZE]; //void ogl_filltexbuf(unsigned char *data,GLubyte *texp,int width,int height,int twidth,int theight); void ogl_filltexbuf(unsigned char *data,GLubyte *texp,int truewidth,int width,int height,int dxo,int dyo,int twidth,int theight,int type); @@ -127,6 +142,7 @@ void ogl_cache_level_textures(void); void ogl_urect(int left,int top,int right,int bot); bool ogl_ubitmapm_c(int x, int y,grs_bitmap *bm,int c); bool ogl_ubitmapm(int x, int y,grs_bitmap *bm); +bool ogl_ubitblt_i(int dw,int dh,int dx,int dy, int sw, int sh, int sx, int sy, grs_bitmap * src, grs_bitmap * dest); bool ogl_ubitblt(int w,int h,int dx,int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest); bool ogl_ubitblt_tolinear(int w,int h,int dx,int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest); bool ogl_ubitblt_copy(int w,int h,int dx,int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest); diff --git a/include/pstypes.h b/include/pstypes.h index d470da82..a8d49b5c 100644 --- a/include/pstypes.h +++ b/include/pstypes.h @@ -22,30 +22,33 @@ typedef signed char byte; //define unsigned types; typedef unsigned char ubyte; -#ifdef __ENV_LINUX__ +#ifndef __ENV_LINUX__ +typedef unsigned short ushort; +typedef unsigned int uint; +typedef unsigned long ulong; +#endif + +# define min(a,b) (((a)>(b))?(b):(a)) +# define max(a,b) (((a)<(b))?(b):(a)) + +#if defined __MINGW32__ +#include +typedef uint32_t u_int32_t; + +#elif defined __ENV_LINUX__ # include # define _MAX_PATH 1024 # define _MAX_DIR 256 -# define min(a,b) (((a)>(b))?(b):(a)) -# define max(a,b) (((a)<(b))?(b):(a)) + #elif defined __ENV_DJGPP__ # include -# define min(a,b) (((a)>(b))?(b):(a)) -# define max(a,b) (((a)<(b))?(b):(a)) # define _MAX_PATH 255 # define _MAX_DIR 63 -typedef unsigned short ushort; -typedef unsigned int uint; -typedef unsigned long ulong; -typedef signed long int32_t; -typedef unsigned long u_int32_t; +typedef signed int int32_t; +typedef unsigned int u_int32_t; typedef signed short int16_t; typedef unsigned short u_int16_t; -#else -typedef unsigned short ushort; -typedef unsigned int uint; -typedef unsigned long ulong; #endif //define a boolean diff --git a/include/strutil.h b/include/strutil.h index ceeb83a6..ff945cda 100644 --- a/include/strutil.h +++ b/include/strutil.h @@ -11,30 +11,27 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ -#ifndef _STRUTILS_ -#define _STRUTILS_ +#ifndef _STRUTILS_H +#define _STRUTILS_H char *d_strdup(char *str); -#ifdef __ENV_LINUX__ +#if defined(__ENV_LINUX__) #define stricmp(a,b) strcasecmp(a,b) #define strnicmp(a,b,c) strncasecmp(a,b,c) - -void strupr( char *s1 ); -void strlwr( char *s1 ); -#elif defined __ENV_DJGPP__ -// Nothing needed - -#else +#elif 0 extern int stricmp(char *str1, char *str2); extern int strnicmp(char *str1, char *str2, int n); +#endif +#ifndef __MINGW32__ +#ifndef __ENV_DJGPP__ void strupr( char *s1 ); void strlwr( char *s1 ); #endif void strrev( char *s1 ); - void _splitpath(char *name, char *drive, char *path, char *base, char *ext); - #endif + +#endif /* _STRUTILS_H */ diff --git a/include/u_mem.h b/include/u_mem.h index 8fe1606c..61c683c4 100644 --- a/include/u_mem.h +++ b/include/u_mem.h @@ -11,6 +11,8 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#include + #ifdef MACINTOSH extern ubyte virtual_memory_on; #endif @@ -35,10 +37,9 @@ void mem_validate_heap(); #else -#define free(ptr) do{ free(ptr); ptr=NULL; } while(0) +#define d_malloc(size) malloc(size) +#define d_free(ptr) do{ free(ptr); ptr=NULL; } while(0) #define MALLOC( var, type, count ) (var=(type *)malloc((count)*sizeof(type))) #endif - - diff --git a/input/Makefile.am b/input/Makefile.am index 3fa3e94c..a958b36b 100644 --- a/input/Makefile.am +++ b/input/Makefile.am @@ -1,19 +1,45 @@ -noinst_LIBRARIES = libinput.a -INCLUDES = -I $(top_srcdir)/includes -I $(top_srcdir)/main +SUBDIRS = linux -libinput_a_SOURCES = sdl_event.c sdl_key.c sdl_mouse.c \ -ggi_event.c ggi_key.c ggi_mouse.c \ -dos_key.c dos_joyc.c dos_joydefs.c dos_mouse.c\ -linux_joydefs.c linux_joystick.c +INCLUDES = -I$(top_srcdir)/includes -I$(top_srcdir)/main -I$(top_srcdir)/arch/include + +noinst_LIBRARIES = libinput.a if ENV_DJGPP - SUFFIXES = .asm - %.o: %.asm - $(NASM) $(NASMFLAGS) $< -o $@ +libinput_a_SOURCES = dos_key.c dos_joyc.c dos_joydefs.c dos_mouse.c +else +if MINGW32 +libinput_a_SOURCES = sdl_event.c sdl_key.c sdl_mouse.c sdl_joy.c sdl_joydefs.c +else +if USE_GGI +libinput_a_SOURCES = linux_joydefs.c linux_joystick.c \ +ggi_event.c ggi_key.c ggi_mouse.c +else +if USE_SVGALIB +libinput_a_SOURCES = linux_joydefs.c linux_joystick.c \ +svgalib_event.c svgalib_key.c svgalib_mouse.c svgalib_init.c +else +libinput_a_SOURCES = linux_joydefs.c linux_joystick.c \ +sdl_event.c sdl_key.c sdl_mouse.c +endif +endif +endif +endif +EXTRA_libinput_a_SOURCES = \ +dos_key.c dos_joyc.c dos_joydefs.c dos_mouse.c \ +ggi_event.c ggi_key.c ggi_mouse.c \ +linux_joydefs.c linux_joystick.c \ +sdl_event.c sdl_key.c sdl_mouse.c sdl_joy.c sdl_joydefs.c \ +svgalib_event.c svgalib_key.c svgalib_mouse.c svgalib_init.c +SUFFIXES = .asm +%.o: %.asm + $(NASM) $(NASMFLAGS) $< -o $@ - libinput_a_SOURCES += dos_joy2.asm - libinput_a_LIBADD += dos_joy2.o - dos_joyc.c: dos_joy2.o +if ENV_DJGPP +libinput_a_LIBADD = dos_joy2.o endif + +EXTRA_DIST = \ +dos_joy2.asm \ +ggi_init.c diff --git a/input/Makefile.in b/input/Makefile.in deleted file mode 100644 index 79e73f77..00000000 --- a/input/Makefile.in +++ /dev/null @@ -1,313 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# 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. - -# 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. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CFLAGS = @CFLAGS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NASM = @NASM@ -NASMFLAGS = @NASMFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -SDL_LIBS = @SDL_LIBS@ -VERSION = @VERSION@ - -noinst_LIBRARIES = libinput.a -INCLUDES = -I $(top_srcdir)/includes -I $(top_srcdir)/main - -libinput_a_SOURCES = sdl_event.c sdl_key.c sdl_mouse.c ggi_event.c ggi_key.c ggi_mouse.c dos_key.c dos_joyc.c dos_joydefs.c dos_mouse.c linux_joydefs.c linux_joystick.c - -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../conf.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I.. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -libinput_a_LIBADD = -libinput_a_OBJECTS = sdl_event.o sdl_key.o sdl_mouse.o ggi_event.o \ -ggi_key.o ggi_mouse.o dos_key.o dos_joyc.o dos_joydefs.o dos_mouse.o \ -linux_joydefs.o linux_joystick.o -AR = ar -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -DEP_FILES = .deps/dos_joyc.P .deps/dos_joydefs.P .deps/dos_key.P \ -.deps/dos_mouse.P .deps/ggi_event.P .deps/ggi_key.P .deps/ggi_mouse.P \ -.deps/linux_joydefs.P .deps/linux_joystick.P .deps/sdl_event.P \ -.deps/sdl_key.P .deps/sdl_mouse.P -SOURCES = $(libinput_a_SOURCES) -OBJECTS = $(libinput_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu input/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -.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: - -libinput.a: $(libinput_a_OBJECTS) $(libinput_a_DEPENDENCIES) - -rm -f libinput.a - $(AR) cru libinput.a $(libinput_a_OBJECTS) $(libinput_a_LIBADD) - $(RANLIB) libinput.a - -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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - 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 = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = input - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu input/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - 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 - @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 -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -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-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-depend mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - 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-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags 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 \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -@ENV_DJGPP_TRUE@ SUFFIXES = .asm -@ENV_DJGPP_TRUE@ %.o: %.asm -@ENV_DJGPP_TRUE@ $(NASM) $(NASMFLAGS) $< -o $@ - -@ENV_DJGPP_TRUE@ libinput_a_SOURCES += dos_joy2.asm -@ENV_DJGPP_TRUE@ libinput_a_LIBADD += dos_joy2.o -@ENV_DJGPP_TRUE@ dos_joyc.c: dos_joy2.o - -# 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/input/dos_joyc.c b/input/dos_joyc.c index 870f291c..260874af 100644 --- a/input/dos_joyc.c +++ b/input/dos_joyc.c @@ -11,9 +11,159 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +/* + * $Source: /cvs/cvsroot/d2x/input/dos_joyc.c,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 14:03:56 $ + * + * Routines for joystick reading. + * + * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/01/24 04:29:45 bradleyb + * changed args_find to FindArg + * + * Revision 1.1.1.2 2001/01/19 03:33:52 bradleyb + * Import of d2x-0.0.9-pre1 + * + * Revision 1.1.1.1 1999/06/14 21:58:26 donut + * Import of d1x 1.37 source. + * + * Revision 1.37 1995/10/07 13:22:31 john + * Added new method of reading joystick that allows higher-priority + * interrupts to go off. + * + * Revision 1.36 1995/03/30 11:03:40 john + * Made -JoyBios read buttons using BIOS. + * + * Revision 1.35 1995/02/14 11:39:25 john + * Added polled/bios joystick readers.. + * + * Revision 1.34 1995/02/10 17:06:12 john + * Fixed bug with plugging in a joystick not getting detected. + * + * Revision 1.33 1995/01/27 16:39:42 john + * Made so that if no joystick detected, it wont't + * read buttons. + * + * Revision 1.32 1995/01/12 13:16:40 john + * Made it so that joystick can't lose an axis + * by 1 weird reading. Reading has to occurr during + * calibration for this to happen. + * + * Revision 1.31 1994/12/28 15:56:03 john + * Fixed bug that refused to read joysticks whose + * min,cen,max were less than 100 apart. + * + * Revision 1.30 1994/12/28 15:31:53 john + * Added code to read joystick axis not all at one time. + * + * Revision 1.29 1994/12/27 15:44:36 john + * Made the joystick timeout be at 1/100th of a second, + * regardless of CPU speed. + * + * Revision 1.28 1994/12/04 11:54:54 john + * Made stick read at whatever rate the clock is at, not + * at 18.2 times/second. + * + * Revision 1.27 1994/11/29 02:25:40 john + * Made it so that the scaled reading returns 0 + * if the calibration factors look funny.. + * + * Revision 1.26 1994/11/22 11:08:07 john + * Commented out the ARCADE joystick. + * + * Revision 1.25 1994/11/14 19:40:26 john + * Fixed bug with no joystick being detected. + * + * Revision 1.24 1994/11/14 19:36:40 john + * Took out initial cheapy calibration. + * + * Revision 1.23 1994/11/14 19:13:27 john + * Took out the calibration in joy_init + * + * Revision 1.22 1994/10/17 10:09:57 john + * Made the state look at last_State, so that a joy_flush + * doesn't cause a new down state to be added next reading. + * + * Revision 1.21 1994/10/13 11:36:23 john + * Made joy_down_time be kept track of in fixed seconds, + * not ticks. + * + * Revision 1.20 1994/10/12 16:58:50 john + * Fixed bug w/ previous comment. + * + * Revision 1.19 1994/10/12 16:57:44 john + * Added function to set a joystick button's state. + * + * Revision 1.18 1994/10/11 10:20:13 john + * Fixed Flightstick Pro/ + * .. + * + * Revision 1.17 1994/09/29 18:29:20 john + * *** empty log message *** + * + * Revision 1.16 1994/09/27 19:17:23 john + * Added code so that is joy_init is never called, joystick is not + * used at all. + * + * Revision 1.15 1994/09/22 16:09:23 john + * Fixed some virtual memory lockdown problems with timer and + * joystick. + * + * Revision 1.14 1994/09/16 11:44:42 john + * Fixed bug with slow joystick. + * + * Revision 1.13 1994/09/16 11:36:15 john + * Fixed bug with reading non-present channels. + * + * Revision 1.12 1994/09/15 20:52:48 john + * rme john + * Added support for the Arcade style joystick. + * + * Revision 1.11 1994/09/13 20:04:49 john + * Fixed bug with joystick button down_time. + * + * Revision 1.10 1994/09/10 13:48:07 john + * Made all 20 buttons read. + * + * Revision 1.9 1994/08/31 09:55:02 john + * *** empty log message *** + * + * Revision 1.8 1994/08/29 21:02:14 john + * Added joy_set_cal_values... + * + * Revision 1.7 1994/08/29 20:52:17 john + * Added better cyberman support; also, joystick calibration + * value return funcctiionn, + * + * Revision 1.6 1994/08/24 18:53:12 john + * Made Cyberman read like normal mouse; added dpmi module; moved + * mouse from assembly to c. Made mouse buttons return time_down. + * + * Revision 1.5 1994/07/14 22:12:23 john + * Used intrinsic forms of outp to fix vmm error. + * + * Revision 1.4 1994/07/07 19:52:59 matt + * Made joy_init() return success/fail flag + * Made joy_init() properly detect a stick if one is plugged in after joy_init() + * was called the first time. + * + * Revision 1.3 1994/07/01 10:55:55 john + * Fixed some bugs... added support for 4 axis. + * + * Revision 1.2 1994/06/30 20:36:55 john + * Revamped joystick code. + * + * Revision 1.1 1994/06/30 15:42:15 john + * Initial revision + * + * + */ + +#ifdef HAVE_CONFIG_H #include - -#ifdef __ENV_DJGPP__ +#endif #include #include @@ -299,9 +449,9 @@ int joy_init() int i; int temp_axis[4]; -// if(args_find("-joy209")) +// if(FindArg("-joy209")) // use_alt_joyport=1; - if(args_find("-joy209")) + if(FindArg("-joy209")) JOY_PORT = 521; //209h; joy_flush(); @@ -653,5 +803,3 @@ void joy_poll() if ( joystick.slow_read & JOY_BIOS_READINGS ) joystick.last_value = joy_read_buttons_bios2(); } - -#endif // __ENV_DJGPP__ diff --git a/input/dos_joydefs.c b/input/dos_joydefs.c index 5825c269..8124f923 100644 --- a/input/dos_joydefs.c +++ b/input/dos_joydefs.c @@ -11,9 +11,272 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +/* + * $Source: /cvs/cvsroot/d2x/input/dos_joydefs.c,v $ + * $Revision: 1.2 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 14:03:57 $ + * + * . + * + * $Log: not supported by cvs2svn $ + * Revision 1.1.1.2 2001/01/19 03:33:52 bradleyb + * Import of d2x-0.0.9-pre1 + * + * Revision 1.1.1.1 1999/06/14 21:58:29 donut + * Import of d1x 1.37 source. + * + * Revision 2.2 1995/06/30 12:30:22 john + * Added -Xname command line. + * + * Revision 2.1 1995/04/06 12:13:20 john + * Made so you can calibrate Gravis Gamepad. + * + * Revision 2.0 1995/02/27 11:30:27 john + * New version 2.0, which has no anonymous unions, builds with + * Watcom 10.0, and doesn't require parsing BITMAPS.TBL. + * + * Revision 1.71 1995/02/12 02:06:10 john + * Fixed bug with joystick incorrectly asking for + * calibration. + * + * Revision 1.70 1995/01/28 15:58:07 john + * Made joystick calibration be only when wrong detected in + * menu or joystick axis changed. + * + * Revision 1.69 1995/01/25 14:37:55 john + * Made joystick only prompt for calibration once... + * + * Revision 1.68 1995/01/24 16:34:29 john + * Made so that if you reconfigure joystick and + * add or subtract an axis, it asks for a recalibration + * upon leaving. + * + * Revision 1.67 1994/12/29 11:08:51 john + * Fixed Thrustmaster and Logitech Wingman extreme + * Hat by reading the y2 axis during the center stage + * of the calibration, and using 75, 50, 27, and 3 % + * as values for the 4 positions. + * + * Revision 1.66 1994/12/15 18:17:39 john + * Fixed warning with previous. + * + * Revision 1.65 1994/12/15 18:15:48 john + * Made the joy cal only write the .cfg file, not + * the player file. + * + * Revision 1.64 1994/12/13 14:43:35 john + * Took out the code in kconfig to build direction array. + * Called kc_set_controls after selecting a new control type. + * + * Revision 1.63 1994/12/10 12:08:47 john + * Changed some delays to use TICKER instead of timer_get_fixed_seconds. + * + * Revision 1.62 1994/12/09 11:01:07 mike + * force calibration of joystick on joystick selection from Controls... menu. + * + * Revision 1.61 1994/12/07 21:50:27 john + * Put stop/start time around joystick delay. + * + * Revision 1.60 1994/12/07 19:34:39 john + * Added delay. + * + * Revision 1.59 1994/12/07 18:12:14 john + * NEatened up joy cal., + * + * Revision 1.58 1994/12/07 17:07:51 john + * Fixed up joy cal. + * + * Revision 1.57 1994/12/07 16:48:53 yuan + * localization + * + * Revision 1.56 1994/12/07 16:05:55 john + * Changed the way joystick calibration works. + * + * Revision 1.55 1994/12/06 20:15:22 john + * Took out code that unpauses songs that were never paused. + * + * Revision 1.54 1994/12/06 15:14:09 yuan + * Localization + * + * Revision 1.53 1994/12/05 16:29:16 john + * Took out music pause around the cheat menu. + * + * Revision 1.52 1994/12/04 12:39:10 john + * MAde so that FCS calibration doesn't ask for axis #2. + * + * Revision 1.51 1994/12/03 15:14:59 john + * Took out the delay mentioned previosuly cause it would + * cause bigger problems than it helps, especially with netgames. + * + * Revision 1.50 1994/12/03 14:16:14 john + * Put a delay between screens in joy cal to keep Yuan from + * double hitting. + * + * Revision 1.49 1994/12/03 11:04:06 john + * Changed newmenu code a bit to fix bug with bogus + * backgrounds occcasionally. + * + * Revision 1.48 1994/12/02 11:03:44 yuan + * Localization. + * + * Revision 1.47 1994/12/02 10:50:33 yuan + * Localization + * + * Revision 1.46 1994/12/01 12:21:59 john + * Added code to calibrate 2 joysticks separately. + * + * Revision 1.45 1994/12/01 11:52:31 john + * Added message when you select FCS to say that if + * you have WCS, see manuel. + * + * Revision 1.44 1994/11/29 02:26:28 john + * Made the prompts for upper-left, lower right for joy + * calibration more obvious. + * + * Revision 1.43 1994/11/26 13:13:59 matt + * Changed "none" option to "keyboard only" + * + * Revision 1.42 1994/11/21 19:35:13 john + * Replaced calls to joy_init with if (joy_present) + * + * Revision 1.41 1994/11/21 19:28:34 john + * Changed warning for no joystick to use nm_messagebox.. + * + * Revision 1.40 1994/11/21 19:06:25 john + * Made it so that it only stops sound when your in game mode. + * + * Revision 1.39 1994/11/21 11:47:18 john + * Made sound pause during joystick calibration. + * + * Revision 1.38 1994/11/10 20:34:18 rob + * Removed menu-specific network mode support in favor in new stuff + * in newmenu.c + * + * Revision 1.37 1994/11/08 21:21:38 john + * Made Esc exit joystick calibration. + * + * Revision 1.36 1994/11/08 15:14:42 john + * Added more calls so net doesn't die in net game. + * + * Revision 1.35 1994/11/08 14:59:12 john + * Added code to respond to network while in menus. + * + * Revision 1.34 1994/10/24 19:56:32 john + * Made the new user setup prompt for config options. + * + * Revision 1.33 1994/10/22 14:11:52 mike + * Suppress compiler warning message. + * + * Revision 1.32 1994/10/19 12:44:24 john + * Added hours field to player structure. + * + * Revision 1.31 1994/10/17 13:07:13 john + * Moved the descent.cfg info into the player config file. + * + * Revision 1.30 1994/10/13 21:41:12 john + * MAde Esc exit out of joystick calibration. + * + * Revision 1.29 1994/10/13 19:22:27 john + * Added separate config saves for different devices. + * Made all the devices work together better, such as mice won't + * get read when you're playing with the joystick. + * + * Revision 1.28 1994/10/13 11:40:18 john + * Took out warnings. + * + * Revision 1.27 1994/10/13 11:35:23 john + * Made Thrustmaster FCS Hat work. Put a background behind the + * keyboard configure. Took out turn_sensitivity. Changed sound/config + * menu to new menu. Made F6 be calibrate joystick. + * + * Revision 1.26 1994/10/11 21:29:03 matt + * Made a bunch of menus have good initial selected values + * + * Revision 1.25 1994/10/11 17:08:39 john + * Added sliders for volume controls. + * + * Revision 1.24 1994/10/10 17:59:21 john + * Neatend previous. + * + * Revision 1.23 1994/10/10 17:57:59 john + * Neatend previous. + * + * Revision 1.22 1994/10/10 17:56:11 john + * Added messagebox that tells that config has been saved. + * + * Revision 1.21 1994/09/30 12:37:26 john + * Added midi,digi volume to configuration. + * + * Revision 1.20 1994/09/22 16:14:14 john + * Redid intro sequecing. + * + * Revision 1.19 1994/09/19 18:50:15 john + * Added switch to disable joystick. + * + * Revision 1.18 1994/09/12 11:47:36 john + * Made stupid cruise work better. Make kconfig values get + * read/written to disk. + * + * Revision 1.17 1994/09/10 15:46:47 john + * First version of new keyboard configuration. + * + * Revision 1.16 1994/09/06 19:35:44 john + * Fixed bug that didn';t load new size .cal file. + * + * Revision 1.15 1994/09/06 14:51:58 john + * Added sensitivity adjustment, fixed bug with joystick button not + * staying down. + * + * Revision 1.14 1994/09/02 16:13:47 john + * Made keys fill in position. + * + * Revision 1.13 1994/08/31 17:58:50 john + * Made a bit simpler. + * + * Revision 1.12 1994/08/31 14:17:54 john + * *** empty log message *** + * + * Revision 1.11 1994/08/31 14:10:56 john + * Made keys not work when KEY_DELETE pressed. + * + * Revision 1.10 1994/08/31 13:40:47 mike + * Change constant + * + * Revision 1.9 1994/08/31 12:56:27 john + * *** empty log message *** + * + * Revision 1.8 1994/08/30 20:38:29 john + * Add more config stuff.. + * + * Revision 1.7 1994/08/30 16:37:25 john + * Added menu options to set controls. + * + * Revision 1.6 1994/08/30 09:27:18 john + * *** empty log message *** + * + * Revision 1.5 1994/08/30 09:12:01 john + * *** empty log message *** + * + * Revision 1.4 1994/08/29 21:18:32 john + * First version of new keyboard/oystick remapping stuff. + * + * Revision 1.3 1994/08/24 19:00:29 john + * Changed key_down_time to return fixed seconds instead of + * milliseconds. + * + * Revision 1.2 1994/08/17 16:50:37 john + * Added damaging fireballs, missiles. + * + * Revision 1.1 1994/08/17 10:07:12 john + * Initial revision + * + * + */ + +#ifdef HAVE_CONFIG_H #include - -#ifdef __ENV_DJGPP__ +#endif #include #include @@ -414,6 +677,3 @@ void joydefs_config() } } - - -#endif // __ENV_DJGPP__ diff --git a/input/dos_key.c b/input/dos_key.c index 387f01b6..fbc8762e 100644 --- a/input/dos_key.c +++ b/input/dos_key.c @@ -11,14 +11,150 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +/* + * $Source: /cvs/cvsroot/d2x/input/dos_key.c,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-01-31 14:04:44 $ + * + * Functions for keyboard handler. + * + * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/01/29 14:03:57 bradleyb + * Fixed build, minor fixes + * + * Revision 1.1.1.2 2001/01/19 03:33:52 bradleyb + * Import of d2x-0.0.9-pre1 + * + * Revision 1.1.1.1 1999/06/14 21:58:32 donut + * Import of d1x 1.37 source. + * + * Revision 1.35 1995/01/25 20:13:30 john + * Took out not passing keys to debugger if w10. + * + * Revision 1.34 1995/01/14 19:19:31 john + * Made so when you press Shift+Baskspace, it release keys autmatically. + * + * Revision 1.33 1994/12/13 09:21:48 john + * Took out keyd_editor_mode, and KEY_DEBUGGED stuff for NDEBUG versions. + * + * Revision 1.32 1994/11/12 13:52:01 john + * Fixed bug with code that cleared bios buffer. + * + * Revision 1.31 1994/10/24 15:16:16 john + * Added code to detect KEY_PAUSE. + * + * Revision 1.30 1994/10/24 13:57:53 john + * Hacked in support for pause key onto code 0x61. + * + * Revision 1.29 1994/10/21 15:18:13 john + * *** empty log message *** + * + * Revision 1.28 1994/10/21 15:17:24 john + * Made LSHIFT+BACKSPACE do what PrtScr used to. + * + * Revision 1.27 1994/09/22 16:09:18 john + * Fixed some virtual memory lockdown problems with timer and + * joystick. + * + * Revision 1.26 1994/09/15 21:32:47 john + * Added bounds checking for down_count scancode + * parameter. + * + * Revision 1.25 1994/08/31 12:22:20 john + * Added KEY_DEBUGGED + * + * Revision 1.24 1994/08/24 18:53:48 john + * Made Cyberman read like normal mouse; added dpmi module; moved + * mouse from assembly to c. Made mouse buttons return time_down. + * + * Revision 1.23 1994/08/18 15:17:51 john + * *** empty log message *** + * + * Revision 1.22 1994/08/18 15:16:38 john + * fixed some bugs with clear_key_times and then + * removed it because i fixed key_flush to do the + * same. + * + * Revision 1.21 1994/08/17 19:01:25 john + * Attempted to fix a bug with a key being held down + * key_flush called, then the key released having too + * long of a time. + * + * Revision 1.20 1994/08/08 10:43:48 john + * Recorded when a key was pressed for key_inkey_time. + * + * Revision 1.19 1994/06/22 15:00:03 john + * Made keyboard close automatically on exit. + * + * Revision 1.18 1994/06/21 09:16:29 john + * *** empty log message *** + * + * Revision 1.17 1994/06/21 09:08:23 john + * *** empty log message *** + * + * Revision 1.16 1994/06/21 09:05:01 john + * *** empty log message *** + * + * Revision 1.15 1994/06/21 09:04:24 john + * Made PrtScreen do an int5 + * + * Revision 1.14 1994/06/17 17:17:06 john + * Added keyd_time_last_key_was_pressed or something like that. + * + * Revision 1.13 1994/05/14 13:55:16 matt + * Added #define to control key passing to bios + * + * Revision 1.12 1994/05/05 18:09:39 john + * Took out BIOS to prevent stuck keys. + * + * Revision 1.11 1994/05/03 17:39:12 john + * *** empty log message *** + * + * Revision 1.10 1994/04/29 12:14:20 john + * Locked all memory used during interrupts so that program + * won't hang when using virtual memory. + * + * Revision 1.9 1994/04/28 23:49:41 john + * Made key_flush flush more keys and also did something else but i forget what. + * + * Revision 1.8 1994/04/22 12:52:12 john + * *** empty log message *** + * + * Revision 1.7 1994/04/01 10:44:59 mike + * Change key_getch() to call getch() if our interrupt hasn't been installed. + * + * Revision 1.6 1994/03/09 10:45:48 john + * Neatend code a bit. + * + * Revision 1.5 1994/02/17 17:24:16 john + * Neatened up a bit. + * + * Revision 1.4 1994/02/17 16:30:29 john + * Put in code to pass keys when in debugger. + * + * Revision 1.3 1994/02/17 15:57:59 john + * Made handler not chain to BIOS handler. + * + * Revision 1.2 1994/02/17 15:56:06 john + * Initial version. + * + * Revision 1.1 1994/02/17 15:54:07 john + * Initial revision + * + * + */ + //#define PASS_KEYS_TO_BIOS 1 //if set, bios gets keys +#ifdef HAVE_CONFIG_H #include +#endif -#ifdef __ENV_DJGPP__ #include #include #include +#include /* for getch */ //#define WATCOM_10 #ifdef __DJGPP__ @@ -580,5 +716,3 @@ void key_close() _enable(); } - -#endif // __ENV_DJGPP__ diff --git a/input/dos_mouse.c b/input/dos_mouse.c index a4f3395f..6bf146de 100644 --- a/input/dos_mouse.c +++ b/input/dos_mouse.c @@ -11,9 +11,70 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +/* + * $Source: /cvs/cvsroot/d2x/input/dos_mouse.c,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-01-31 14:04:44 $ + * + * Functions to access Mouse and Cyberman... + * + * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/01/29 14:03:57 bradleyb + * Fixed build, minor fixes + * + * Revision 1.1.1.2 2001/01/19 03:33:52 bradleyb + * Import of d2x-0.0.9-pre1 + * + * Revision 1.1.1.1 1999/06/14 21:58:38 donut + * Import of d1x 1.37 source. + * + * Revision 1.11 1995/02/10 18:52:17 john + * Fixed bug with mouse not getting closed. + * + * Revision 1.10 1995/02/02 11:10:33 john + * Changed a bunch of mouse stuff around to maybe get + * around PS/2 mouse hang. + * + * Revision 1.9 1995/01/14 19:19:52 john + * Fixed signed short error cmp with -1 that caused mouse + * to break under Watcom 10.0 + * + * Revision 1.8 1994/12/27 12:38:23 john + * Made mouse use temporary dos buffer instead of + * + * allocating its own. + * + * + * Revision 1.7 1994/12/05 23:54:53 john + * Fixed bug with mouse_get_delta only returning positive numbers.. + * + * Revision 1.6 1994/11/18 23:18:18 john + * Changed some shorts to ints. + * + * Revision 1.5 1994/09/13 12:34:02 john + * Added functions to get down count and state. + * + * Revision 1.4 1994/08/29 20:52:19 john + * Added better cyberman support; also, joystick calibration + * value return funcctiionn, + * + * Revision 1.3 1994/08/24 18:54:32 john + * *** empty log message *** + * + * Revision 1.2 1994/08/24 18:53:46 john + * Made Cyberman read like normal mouse; added dpmi module; moved + * mouse from assembly to c. Made mouse buttons return time_down. + * + * Revision 1.1 1994/08/24 13:56:37 john + * Initial revision + * + * + */ + +#ifdef HAVE_CONFIG_H #include - -#ifdef __ENV_DJGPP__ +#endif #ifdef __DJGPP__ #include @@ -267,7 +328,9 @@ void _loadds far mouse_handler (int m_ax, int mbx, int mcx, int mdx, int msi, in void mouse_handler_end (void) // dummy functions { } +#ifndef __DJGPP__ #pragma on (check_stack) +#endif //-------------------------------------------------------- // returns 0 if no mouse @@ -600,5 +663,3 @@ void mouse_get_cyberman_pos( int *x, int *y ) *x = (((ei->x+8128)*256)/(8064+8128+1)) - 127; *y = (((ei->y+8128)*256)/(8064+8128+1)) - 127; } - -#endif // __ENV_DJGPP__ diff --git a/input/ggi/Makefile.am b/input/ggi/Makefile.am deleted file mode 100644 index cce89685..00000000 --- a/input/ggi/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -noinst_LIBRARIES = libinputggi.a -INCLUDES = -I$(top_srcdir)/includes -I$(top_srcdir)/main -Iinclude - -libinputggi_a_SOURCES = \ -event.c key.c mouse.c diff --git a/input/ggi/Makefile.in b/input/ggi/Makefile.in deleted file mode 100644 index fe54753c..00000000 --- a/input/ggi/Makefile.in +++ /dev/null @@ -1,300 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# 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. - -# 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. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = ../.. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CFLAGS = @CFLAGS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NASM = @NASM@ -NASMFLAGS = @NASMFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -SDL_LIBS = @SDL_LIBS@ -VERSION = @VERSION@ - -noinst_LIBRARIES = libinputggi.a -INCLUDES = -I$(top_srcdir)/includes -I$(top_srcdir)/main -Iinclude - -libinputggi_a_SOURCES = event.c key.c mouse.c - -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../../conf.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I../.. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -libinputggi_a_LIBADD = -libinputggi_a_OBJECTS = event.o key.o mouse.o -AR = ar -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -DEP_FILES = .deps/event.P .deps/key.P .deps/mouse.P -SOURCES = $(libinputggi_a_SOURCES) -OBJECTS = $(libinputggi_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu input/ggi/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -.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: - -libinputggi.a: $(libinputggi_a_OBJECTS) $(libinputggi_a_DEPENDENCIES) - -rm -f libinputggi.a - $(AR) cru libinputggi.a $(libinputggi_a_OBJECTS) $(libinputggi_a_LIBADD) - $(RANLIB) libinputggi.a - -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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - 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 = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = input/ggi - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu input/ggi/Makefile - @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 - -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 - @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 -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -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-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-depend mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - 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-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags 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 \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -# 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/input/ggi/event.c b/input/ggi/event.c deleted file mode 100644 index 3ba2697c..00000000 --- a/input/ggi/event.c +++ /dev/null @@ -1,127 +0,0 @@ -#include -#include -#include -#include -#include -#include "event.h" -#include "error.h" -#include "fix.h" - -static int initialised=0; - -#ifdef GGI_VIDEO -#include -extern ggi_visual_t *screenvis; -#endif -gii_input_t inputs; - -extern void keyboard_handler(int key, ubyte state); -extern void mouse_handler_button(int button, ubyte state); -extern void mouse_handler_relative(int x, int y); -extern void mouse_handler_absolute(int x, int y); - -void event_poll() -{ - int n; - struct timeval tv; - gii_event event; - - if (!initialised) - event_init(); - if (inputs==NULL) - return; -// Error("GII error: no inputs (perhaps you need to set GII_INPUT env var)\n"); - - tv.tv_sec = 0; - tv.tv_usec = 0; - - giiEventPoll(inputs, emAll, &tv); - - n = giiEventsQueued(inputs, emAll); - - while (n-- > 0) - { - giiEventRead(inputs, &event, emAll); - switch (event.any.type) - { - case evKeyPress: - keyboard_handler(event.key.label, 1); - break; - case evKeyRelease: - keyboard_handler(event.key.label, 0); - break; - case evPtrAbsolute: - mouse_handler_absolute(event.pmove.x, event.pmove.y); - break; - case evPtrRelative: - mouse_handler_relative(event.pmove.x, event.pmove.y); - break; - case evPtrButtonPress: - mouse_handler_button(event.pbutton.button, 1); - break; - case evPtrButtonRelease: - mouse_handler_button(event.pbutton.button, 0); - break; - } - } -} - -void event_close() -{ - if (inputs) - giiClose(inputs); - giiExit(); -} - -#ifdef GII_XWIN -int gii_xwin_initialized=0; -#include -//void lock_nothing(void){return;} -void init_gii_xwin(Display *disp,Window win){ - printf("gii xwin %i %i\n",initialised,gii_xwin_initialized); - if (!initialised) - event_init(); - if (gii_xwin_initialized){ - gii_event ev; - gii_xwin_cmddata_setparam *giiargs=(gii_xwin_cmddata_setparam *) &ev.cmd.data; - memset(&ev,0,sizeof(gii_cmd_nodata_event)+sizeof(gii_xwin_cmddata_setparam)); - ev.cmd.code=GII_CMDCODE_XWINSETPARAM; - ev.any.type = evCommand; - ev.any.size=sizeof(gii_cmd_nodata_event)+sizeof(gii_xwin_cmddata_setparam); - giiargs->win=win; - giiargs->ptralwaysrel=1; - giiEventSend(inputs,&ev); - }else{ - gii_input_t inputs2; - gii_inputxwin_arg giiargs; - memset(&giiargs,0,sizeof(giiargs)); - giiargs.disp=disp; - giiargs.win=win; - giiargs.ptralwaysrel=1; - //giiargs.gglock=lock_nothing; - inputs2=giiOpen("xwin",&giiargs,NULL); - if (inputs2){ - gii_xwin_initialized=1; - if (inputs) - inputs=giiJoinInputs(inputs,inputs2); - else - inputs=inputs2; - } - } -} -#endif - -int event_init() -{ - if (!initialised){ - giiInit(); -#ifdef GGI_VIDEO - inputs = ggiJoinInputs(screenvis, NULL); -#else - inputs=giiOpen(NULL); -#endif - initialised = 1; - atexit(event_close); - } - return 0; -} diff --git a/input/ggi/include/event.h b/input/ggi/include/event.h deleted file mode 100644 index 35bfd62f..00000000 --- a/input/ggi/include/event.h +++ /dev/null @@ -1,14 +0,0 @@ -// Event header file - -#ifndef _EVENT_H -#define _EVENT_H - -int event_init(); -void event_poll(); - -#ifdef GII_XWIN -#include -void init_gii_xwin(Display *disp,Window win); -#endif - -#endif diff --git a/input/ggi/include/key.h b/input/ggi/include/key.h deleted file mode 100644 index 82545713..00000000 --- a/input/ggi/include/key.h +++ /dev/null @@ -1,273 +0,0 @@ -/* -THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -*/ -/* - * $Source: /cvs/cvsroot/d2x/input/ggi/include/key.h,v $ - * $Revision: 1.1.1.1 $ - * $Author: bradleyb $ - * $Date: 2001-01-19 03:29:59 $ - * - * Header for keyboard functions - * - * $Log: not supported by cvs2svn $ - * Revision 1.2 1999/07/10 02:59:06 donut - * more from orulz - * - * Revision 1.19 1994/10/24 13:58:12 john - * Hacked in support for pause key onto code 0x61. - * - * Revision 1.18 1994/10/21 15:17:10 john - * Added KEY_PRINT_SCREEN - * - * Revision 1.17 1994/08/31 12:22:13 john - * Added KEY_DEBUGGED - * - * Revision 1.16 1994/08/24 18:53:50 john - * Made Cyberman read like normal mouse; added dpmi module; moved - * mouse from assembly to c. Made mouse buttons return time_down. - * - * Revision 1.15 1994/08/18 14:56:16 john - * *** empty log message *** - * - * Revision 1.14 1994/08/08 10:43:24 john - * Recorded when a key was pressed for key_inkey_time. - * - * Revision 1.13 1994/06/17 17:17:28 john - * Added keyd_time_last_key_was_pressed or something like that. - * - * Revision 1.12 1994/04/29 12:14:19 john - * Locked all memory used during interrupts so that program - * won't hang when using virtual memory. - * - * Revision 1.11 1994/02/17 15:57:14 john - * Changed key libary to C. - * - * Revision 1.10 1994/01/31 08:34:09 john - * Fixed reversed lshift/rshift keys. - * - * Revision 1.9 1994/01/18 10:58:17 john - * *** empty log message *** - * - * Revision 1.8 1993/10/16 19:24:43 matt - * Added new function key_clear_times() & key_clear_counts() - * - * Revision 1.7 1993/10/15 10:17:09 john - * added keyd_last_key_pressed and released for use with recorder. - * - * Revision 1.6 1993/10/06 16:20:37 john - * fixed down arrow bug - * - * Revision 1.5 1993/10/04 13:26:42 john - * changed the #defines for scan codes. - * - * Revision 1.4 1993/09/28 11:35:20 john - * added key_peekkey - * - * Revision 1.3 1993/09/20 18:36:43 john - * *** empty log message *** - * - * Revision 1.1 1993/07/10 13:10:39 matt - * Initial revision - * - * - */ - -#ifndef _KEY_H -#define _KEY_H - -#include "fix.h" -#include "pstypes.h" -#include // For 'toupper' - -extern int giiKeyTranslate (int keylabel); - -//========================================================================== -// This installs the int9 vector and initializes the keyboard in buffered -// ASCII mode. key_close simply undoes that. -extern void key_init(); -extern void key_close(); - -//========================================================================== -// These are configuration parameters to setup how the buffer works. -// set keyd_buffer_type to 0 for no key buffering. -// set it to 1 and it will buffer scancodes. -extern unsigned char keyd_buffer_type; -extern unsigned char keyd_repeat; // 1=allow repeating, 0=dont allow repeat - -// keyd_editor_mode... 0=game mode, 1=editor mode. -// Editor mode makes key_down_time always return 0 if modifiers are down. -extern unsigned char keyd_editor_mode; - -// Time in seconds when last key was pressed... -extern volatile int keyd_time_when_last_pressed; - -//========================================================================== -// These are the "buffered" keypress routines. Use them by setting the -// "keyd_buffer_type" variable. - -extern void key_flush(); // Clears the 256 char buffer -extern int key_checkch(); // Returns 1 if a char is waiting -extern int key_getch(); // Gets key if one waiting other waits for one. -extern int key_inkey(); // Gets key if one, other returns 0. -extern int key_inkey_time(fix *time); // Same as inkey, but returns the time the key was pressed down. -extern int key_peekkey(); // Same as inkey, but doesn't remove key from buffer. - -extern unsigned char key_to_ascii(int keycode ); -extern char *key_name(int keycode); // Convert keycode to the name of the key - -extern void key_debug(); // Does an INT3 - -//========================================================================== -// These are the unbuffered routines. Index by the keyboard scancode. - -// Set to 1 if the key is currently down, else 0 -extern volatile unsigned char keyd_pressed[]; -extern volatile unsigned char keyd_last_pressed; -extern volatile unsigned char keyd_last_released; - -// Returns the seconds this key has been down since last call. -extern fix key_down_time(int scancode); - -// Returns number of times key has went from up to down since last call. -extern unsigned int key_down_count(int scancode); - -// Returns number of times key has went from down to up since last call. -extern unsigned int key_up_count(int scancode); - -// Clears the times & counts used by the above functions -// Took out... use key_flush(); -//void key_clear_times(); -//void key_clear_counts(); - -extern char * key_text[256]; - -#define KEY_SHIFTED 0x100 -#define KEY_ALTED 0x200 -#define KEY_CTRLED 0x400 -#define KEY_DEBUGGED 0x800 - -#define KEY_0 0x0B -#define KEY_1 0x02 -#define KEY_2 0x03 -#define KEY_3 0x04 -#define KEY_4 0x05 -#define KEY_5 0x06 -#define KEY_6 0x07 -#define KEY_7 0x08 -#define KEY_8 0x09 -#define KEY_9 0x0A - -#define KEY_A 0x1E -#define KEY_B 0x30 -#define KEY_C 0x2E -#define KEY_D 0x20 -#define KEY_E 0x12 -#define KEY_F 0x21 -#define KEY_G 0x22 -#define KEY_H 0x23 -#define KEY_I 0x17 -#define KEY_J 0x24 -#define KEY_K 0x25 -#define KEY_L 0x26 -#define KEY_M 0x32 -#define KEY_N 0x31 -#define KEY_O 0x18 -#define KEY_P 0x19 -#define KEY_Q 0x10 -#define KEY_R 0x13 -#define KEY_S 0x1F -#define KEY_T 0x14 -#define KEY_U 0x16 -#define KEY_V 0x2F -#define KEY_W 0x11 -#define KEY_X 0x2D -#define KEY_Y 0x15 -#define KEY_Z 0x2C - -#define KEY_MINUS 0x0C -#define KEY_EQUAL 0x0D -#define KEY_DIVIDE 0x35 -#define KEY_SLASH 0x2B -#define KEY_COMMA 0x33 -#define KEY_PERIOD 0x34 -#define KEY_SEMICOL 0x27 - -#define KEY_LBRACKET 0x1A -#define KEY_RBRACKET 0x1B - -#define KEY_RAPOSTRO 0x28 -#define KEY_LAPOSTRO 0x29 - -#define KEY_ESC 0x01 -#define KEY_ENTER 0x1C -#define KEY_BACKSP 0x0E -#define KEY_TAB 0x0F -#define KEY_SPACEBAR 0x39 - -#define KEY_NUMLOCK 0x45 -#define KEY_SCROLLOCK 0x46 -#define KEY_CAPSLOCK 0x3A - -#define KEY_LSHIFT 0x2A -#define KEY_RSHIFT 0x36 - -#define KEY_LALT 0x38 -#define KEY_RALT 0xB8 - -#define KEY_LCTRL 0x1D -#define KEY_RCTRL 0x9D - -#define KEY_F1 0x3B -#define KEY_F2 0x3C -#define KEY_F3 0x3D -#define KEY_F4 0x3E -#define KEY_F5 0x3F -#define KEY_F6 0x40 -#define KEY_F7 0x41 -#define KEY_F8 0x42 -#define KEY_F9 0x43 -#define KEY_F10 0x44 -#define KEY_F11 0x57 -#define KEY_F12 0x58 - -#define KEY_PAD0 0x52 -#define KEY_PAD1 0x4F -#define KEY_PAD2 0x50 -#define KEY_PAD3 0x51 -#define KEY_PAD4 0x4B -#define KEY_PAD5 0x4C -#define KEY_PAD6 0x4D -#define KEY_PAD7 0x47 -#define KEY_PAD8 0x48 -#define KEY_PAD9 0x49 -#define KEY_PADMINUS 0x4A -#define KEY_PADPLUS 0x4E -#define KEY_PADPERIOD 0x53 -#define KEY_PADDIVIDE 0xB5 -#define KEY_PADMULTIPLY 0x37 -#define KEY_PADENTER 0x9C - -#define KEY_INSERT 0xD2 -#define KEY_HOME 0xC7 -#define KEY_PAGEUP 0xC9 -#define KEY_DELETE 0xD3 -#define KEY_END 0xCF -#define KEY_PAGEDOWN 0xD1 -#define KEY_UP 0xC8 -#define KEY_DOWN 0xD0 -#define KEY_LEFT 0xCB -#define KEY_RIGHT 0xCD - -#define KEY_PRINT_SCREEN 0xB7 -#define KEY_PAUSE 0x61 - -#endif diff --git a/input/ggi/include/mouse.h b/input/ggi/include/mouse.h deleted file mode 100644 index 6f44c665..00000000 --- a/input/ggi/include/mouse.h +++ /dev/null @@ -1,127 +0,0 @@ -/* -THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -*/ -/* - * $Source: /cvs/cvsroot/d2x/input/ggi/include/mouse.h,v $ - * $Revision: 1.1.1.1 $ - * $Author: bradleyb $ - * $Date: 2001-01-19 03:29:59 $ - * - * Header for mouse functions - * - * $Log: not supported by cvs2svn $ - * Revision 1.1 1999/06/15 05:38:08 donut - * Orulz' ggi patches. - * - * Revision 1.10 1995/02/02 10:22:29 john - * Added cyberman init parameter. - * - * Revision 1.9 1994/11/18 23:18:09 john - * Changed some shorts to ints. - * - * Revision 1.8 1994/09/13 12:33:49 john - * Added functions to get down count and state. - * - * Revision 1.7 1994/08/29 20:52:20 john - * Added better cyberman support; also, joystick calibration - * value return funcctiionn, - * - * Revision 1.6 1994/08/24 17:54:35 john - * *** empty log message *** - * - * Revision 1.5 1994/08/24 17:51:43 john - * Added transparent cyberman support - * - * Revision 1.4 1993/07/27 09:32:22 john - * *** empty log message *** - * - * Revision 1.3 1993/07/26 10:46:44 john - * added definition for mouse_set_pos - * - * Revision 1.2 1993/07/22 13:07:59 john - * added header for mousesetlimts - * - * Revision 1.1 1993/07/10 13:10:40 matt - * Initial revision - * - * - */ - -#ifndef MOUSE_H -#define MOUSE_H - -#include "pstypes.h" -#include "fix.h" - -#define MOUSE_MAX_BUTTONS 3 - -#define MB_LEFT 0 -#define MB_RIGHT 1 -#define MB_MIDDLE 2 -#define MB_Z_UP 3 -#define MB_Z_DOWN 4 -#define MB_PITCH_BACKWARD 5 -#define MB_PITCH_FORWARD 6 -#define MB_BANK_LEFT 7 -#define MB_BANK_RIGHT 8 -#define MB_HEAD_LEFT 9 -#define MB_HEAD_RIGHT 10 - -#define MOUSE_LBTN 1 -#define MOUSE_RBTN 2 -#define MOUSE_MBTN 4 - -#undef NOMOUSE -#ifndef NOMOUSE - -//======================================================================== -// Check for mouse driver, reset driver if installed. returns number of -// buttons if driver is present. - -extern int mouse_set_limits( int x1, int y1, int x2, int y2 ); -extern void mouse_flush(); // clears all mice events... - -//======================================================================== -extern void mouse_get_pos( int *x, int *y); -extern void mouse_get_delta( int *dx, int *dy ); -extern int mouse_get_btns(); -extern void mouse_set_pos( int x, int y); -extern void mouse_get_cyberman_pos( int *x, int *y ); - -// Returns how long this button has been down since last call. -extern fix mouse_button_down_time(int button); - -// Returns how many times this button has went down since last call. -extern int mouse_button_down_count(int button); - -// Returns 1 if this button is currently down -extern int mouse_button_state(int button); - -#else -// 'Neutered' functions... :-) -#define mouse_init(a) -1 -#define mouse_set_limits(a,b,c,d) -1 -#define mouse_flush() -#define mouse_close() -#define mouse_get_pos(a,b) -#define mouse_get_delta(a,b) -#define mouse_get_btns() 0 -#define mouse_set_pos(a,b) -#define mouse_get_cyberman_pos(a,b) -#define mouse_button_down_time(a) 0 -#define mouse_button_down_count(a) 0 -#define mouse_button_state(a) 0 - -#endif - -#endif - diff --git a/input/ggi/init.c b/input/ggi/init.c deleted file mode 100644 index 80ccebc5..00000000 --- a/input/ggi/init.c +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include -#include -#include "text.h" -#include "event.h" -#include "error.h" -#include "args.h" - -void arch_ggi_init() -{ -} diff --git a/input/ggi/key.c b/input/ggi/key.c deleted file mode 100644 index 8d4cb074..00000000 --- a/input/ggi/key.c +++ /dev/null @@ -1,495 +0,0 @@ -#include -#include -#include - -#include - -#include "event.h" -#include "error.h" -#include "key.h" -#include "timer.h" -#include "mono.h" - -//added on 9/3/98 by Matt Mueller to free some cpu instead of hogging during menus and such -#include "d_delay.h" -//end this section addition - Matt Mueller - -#define KEY_BUFFER_SIZE 16 - -static unsigned char Installed = 0; - -//-------- Variable accessed by outside functions --------- -unsigned char keyd_buffer_type; // 0=No buffer, 1=buffer ASCII, 2=buffer scans -unsigned char keyd_repeat; -unsigned char keyd_editor_mode; -volatile unsigned char keyd_last_pressed; -volatile unsigned char keyd_last_released; -volatile unsigned char keyd_pressed[256]; -volatile int keyd_time_when_last_pressed; - -typedef struct Key_info { - ubyte state; // state of key 1 == down, 0 == up - ubyte last_state; // previous state of key - int counter; // incremented each time key is down in handler - fix timewentdown; // simple counter incremented each time in interrupt and key is down - fix timehelddown; // counter to tell how long key is down -- gets reset to 0 by key routines - ubyte downcount; // number of key counts key was down - ubyte upcount; // number of times key was released -} Key_info; - -typedef struct keyboard { - unsigned short keybuffer[KEY_BUFFER_SIZE]; - Key_info keys[256]; - fix time_pressed[KEY_BUFFER_SIZE]; - unsigned int keyhead, keytail; -} keyboard; - -static /*volatile*/ keyboard key_data; - -char * key_text[256] = { -"","ESC","1","2","3","4","5","6","7","8","9","0","-", -"=","BSPC","TAB","Q","W","E","R","T","Y","U","I","O", -"P","[","]","ƒ","LCTRL","A","S","D","F", -"G","H","J","K","L",";","'","`", -"LSHFT","\\","Z","X","C","V","B","N","M",",", -".","/","RSHFT","PAD*","LALT","SPC", -"CPSLK","F1","F2","F3","F4","F5","F6","F7","F8","F9", -"F10","NMLCK","SCLK","PAD7","PAD8","PAD9","PAD-", -"PAD4","PAD5","PAD6","PAD+","PAD1","PAD2","PAD3","PAD0", -"PAD.","","","","F11","F12","","","","","","","","","", -"","","","","","","","","","","","","","","","","","","","", -"","","","","","","","","","","","","","","","","","","","", -"","","","","","","","","","","","","","","","","","", -"PADƒ","RCTRL","","","","","","","","","","","","","", -"","","","","","","","","","","PAD/","","","RALT","", -"","","","","","","","","","","","","","HOME","‚","PGUP", -"","","","","","END","€","PGDN","INS", -"DEL","","","","","","","","","","","","","","","","","", -"","","","","","","","","","","","","","","","","","","","", -"","","","","","","" }; - -unsigned char ascii_table[128] = -{ 255, 255, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=',255,255, - 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', 255, 255, - 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', 39, '`', - 255, '\\', 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', 255,'*', - 255, ' ', 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,255,255, - 255, 255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255 }; - -unsigned char shifted_ascii_table[128] = -{ 255, 255, '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+',255,255, - 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', 255, 255, - 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"', '~', - 255, '|', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?', 255,255, - 255, ' ', 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,255,255, - 255, 255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255 }; - -int giiKeyTranslate (int keylabel) { - switch (keylabel) - { - case GIIUC_0: return KEY_0; - case GIIUC_1: return KEY_1; - case GIIUC_2: return KEY_2; - case GIIUC_3: return KEY_3; - case GIIUC_4: return KEY_4; - case GIIUC_5: return KEY_5; - case GIIUC_6: return KEY_6; - case GIIUC_7: return KEY_7; - case GIIUC_8: return KEY_8; - case GIIUC_9: return KEY_9; - - case GIIUC_A: return KEY_A; - case GIIUC_B: return KEY_B; - case GIIUC_C: return KEY_C; - case GIIUC_D: return KEY_D; - case GIIUC_E: return KEY_E; - case GIIUC_F: return KEY_F; - case GIIUC_G: return KEY_G; - case GIIUC_H: return KEY_H; - case GIIUC_I: return KEY_I; - case GIIUC_J: return KEY_J; - case GIIUC_K: return KEY_K; - case GIIUC_L: return KEY_L; - case GIIUC_M: return KEY_M; - case GIIUC_N: return KEY_N; - case GIIUC_O: return KEY_O; - case GIIUC_P: return KEY_P; - case GIIUC_Q: return KEY_Q; - case GIIUC_R: return KEY_R; - case GIIUC_S: return KEY_S; - case GIIUC_T: return KEY_T; - case GIIUC_U: return KEY_U; - case GIIUC_V: return KEY_V; - case GIIUC_W: return KEY_W; - case GIIUC_X: return KEY_X; - case GIIUC_Y: return KEY_Y; - case GIIUC_Z: return KEY_Z; - - case GIIUC_Minus: return KEY_MINUS; - case GIIUC_Equal: return KEY_EQUAL; - case GIIUC_Slash: return KEY_DIVIDE; - case GIIUC_BackSlash: return KEY_SLASH; - case GIIUC_Comma: return KEY_COMMA; - case GIIUC_Period: return KEY_PERIOD; - case GIIUC_Semicolon: return KEY_SEMICOL; - - case GIIUC_BracketLeft: return KEY_LBRACKET; - case GIIUC_BracketRight: return KEY_RBRACKET; - - case GIIUC_Apostrophe: return KEY_RAPOSTRO; - case GIIUC_Grave: return KEY_LAPOSTRO; - - case GIIUC_Escape: return KEY_ESC; - case GIIK_Enter: return KEY_ENTER; - case GIIUC_BackSpace: return KEY_BACKSP; - case GIIUC_Tab: return KEY_TAB; - case GIIUC_Space: return KEY_SPACEBAR; - - case GIIK_NumLock: return KEY_NUMLOCK; - case GIIK_ScrollLock: return KEY_SCROLLOCK; - case GIIK_CapsLock: return KEY_CAPSLOCK; - - case GIIK_ShiftL: return KEY_LSHIFT; - case GIIK_ShiftR: return KEY_RSHIFT; - - case GIIK_AltL: return KEY_LALT; - case GIIK_AltR: return KEY_RALT; - - case GIIK_CtrlL: return KEY_LCTRL; - case GIIK_CtrlR: return KEY_RCTRL; - - case GIIK_F1: return KEY_F1; - case GIIK_F2: return KEY_F2; - case GIIK_F3: return KEY_F3; - case GIIK_F4: return KEY_F4; - case GIIK_F5: return KEY_F5; - case GIIK_F6: return KEY_F6; - case GIIK_F7: return KEY_F7; - case GIIK_F8: return KEY_F8; - case GIIK_F9: return KEY_F9; - case GIIK_F10: return KEY_F10; - case GIIK_F11: return KEY_F11; - case GIIK_F12: return KEY_F12; - - case GIIK_P0: return KEY_PAD0; - case GIIK_P1: return KEY_PAD1; - case GIIK_P2: return KEY_PAD2; - case GIIK_P3: return KEY_PAD3; - case GIIK_P4: return KEY_PAD4; - case GIIK_P5: return KEY_PAD5; - case GIIK_P6: return KEY_PAD6; - case GIIK_P7: return KEY_PAD7; - case GIIK_P8: return KEY_PAD8; - case GIIK_P9: return KEY_PAD9; - case GIIK_PMinus: return KEY_PADMINUS; - case GIIK_PPlus: return KEY_PADPLUS; - case GIIK_PDecimal: return KEY_PADPERIOD; - case GIIK_PSlash: return KEY_PADDIVIDE; - case GIIK_PAsterisk: return KEY_PADMULTIPLY; - case GIIK_PEnter: return KEY_PADENTER; - - case GIIK_Insert: return KEY_INSERT; - case GIIK_Home: return KEY_HOME; - case GIIK_PageUp: return KEY_PAGEUP; - case GIIK_Delete: return KEY_DELETE; - case GIIK_End: return KEY_END; - case GIIK_PageDown: return KEY_PAGEDOWN; - case GIIK_Up: return KEY_UP; - case GIIK_Down: return KEY_DOWN; - case GIIK_Left: return KEY_LEFT; - case GIIK_Right: return KEY_RIGHT; - - case GIIK_PrintScreen: return KEY_PRINT_SCREEN; - case GIIK_Pause: return KEY_PAUSE; - } - return 0; -} - -//killed on 10/03/98 by Matt Mueller -//unsigned char key_to_ascii(int a) -//{ -// if (!isprint(a)) return 255; -// if (a & KEY_SHIFTED) { -// return (toupper((unsigned char) a)); -// } else { -// return ((unsigned char) a); -// } -//} -//end kill -MM - -//added on 10/03/98 by Matt Mueller to fix shifted keys (copied from dos/key.c) -unsigned char key_to_ascii(int keycode) -{ - int shifted; - - shifted = keycode & KEY_SHIFTED; - keycode &= 0xFF; - - if ( keycode>=127 ) - return 255; - - if (shifted) - return shifted_ascii_table[keycode]; - else - return ascii_table[keycode]; -} -//end addition -MM - -void keyboard_handler(int button, ubyte state) -{ - ubyte key_state; - int i, keycode; - unsigned short event_key; - Key_info *key; - unsigned char temp; - - key_state = state; - event_key = giiKeyTranslate(button); - //mprintf((0,"keyboard_handler(%i,%i):%i\n",button,state,event_key)); - - //===================================================== - //Here a translation from win keycodes to mac keycodes! - //===================================================== - - for (i = 255; i >= 0; i--) { - - keycode = i; - key = &(key_data.keys[keycode]); - if (i == event_key) - state = key_state; - else - state = key->last_state; - - if ( key->last_state == state ) { - if (state) { - key->counter++; - keyd_last_pressed = keycode; - keyd_time_when_last_pressed = timer_get_fixed_seconds(); - } - } else { - if (state) { - keyd_last_pressed = keycode; - keyd_pressed[keycode] = 1; - key->downcount += state; - key->state = 1; - key->timewentdown = keyd_time_when_last_pressed = timer_get_fixed_seconds(); - key->counter++; - } else { - keyd_pressed[keycode] = 0; - keyd_last_released = keycode; - key->upcount += key->state; - key->state = 0; - key->counter = 0; - key->timehelddown += timer_get_fixed_seconds() - key->timewentdown; - } - } - if ( (state && !key->last_state) || (state && key->last_state && (key->counter > 30) && (key->counter & 0x01)) ) { - if ( keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) - keycode |= KEY_SHIFTED; - if ( keyd_pressed[KEY_LALT] || keyd_pressed[KEY_RALT]) - keycode |= KEY_ALTED; - if ( keyd_pressed[KEY_LCTRL] || keyd_pressed[KEY_RCTRL]) - keycode |= KEY_CTRLED; - if ( keyd_pressed[KEY_DELETE] ) - keycode |= KEY_DEBUGGED; - temp = key_data.keytail+1; - if ( temp >= KEY_BUFFER_SIZE ) temp=0; - if (temp!=key_data.keyhead) { - key_data.keybuffer[key_data.keytail] = keycode; - key_data.time_pressed[key_data.keytail] = keyd_time_when_last_pressed; - key_data.keytail = temp; - } - } - key->last_state = state; - } -} - -void key_close() -{ - Installed = 0; -} - -void key_init() -{ - Installed=1; - - keyd_time_when_last_pressed = timer_get_fixed_seconds(); - keyd_buffer_type = 1; - keyd_repeat = 1; - -// Clear the keyboard array - key_flush(); - atexit(key_close); -} - -void key_flush() -{ - int i; - fix curtime; - - if (!Installed) - key_init(); - - key_data.keyhead = key_data.keytail = 0; - - //Clear the keyboard buffer - for (i=0; i= KEY_BUFFER_SIZE ) n=0; - return n; -} - -int key_checkch() -{ - int is_one_waiting = 0; - event_poll(); - if (key_data.keytail!=key_data.keyhead) - is_one_waiting = 1; - return is_one_waiting; -} - -int key_inkey() -{ - int key = 0; - if (!Installed) - key_init(); - event_poll(); - if (key_data.keytail!=key_data.keyhead) { - key = key_data.keybuffer[key_data.keyhead]; - key_data.keyhead = add_one(key_data.keyhead); - } -//added 9/3/98 by Matt Mueller to free cpu time instead of hogging during menus and such -// else d_delay(1); -//end addition - Matt Mueller - return key; -} - -int key_inkey_time(fix * time) -{ - int key = 0; - - if (!Installed) - key_init(); - event_poll(); - if (key_data.keytail!=key_data.keyhead) { - key = key_data.keybuffer[key_data.keyhead]; - *time = key_data.time_pressed[key_data.keyhead]; - key_data.keyhead = add_one(key_data.keyhead); - } - return key; -} - -int key_peekkey() -{ - int key = 0; - event_poll(); - if (key_data.keytail!=key_data.keyhead) - key = key_data.keybuffer[key_data.keyhead]; - - return key; -} - -int key_getch() -{ - int dummy=0; - - if (!Installed) - return 0; -// return getch(); - - while (!key_checkch()) - dummy++; - return key_inkey(); -} - -unsigned int key_get_shift_status() -{ - unsigned int shift_status = 0; - - if ( keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT] ) - shift_status |= KEY_SHIFTED; - - if ( keyd_pressed[KEY_LALT] || keyd_pressed[KEY_RALT] ) - shift_status |= KEY_ALTED; - - if ( keyd_pressed[KEY_LCTRL] || keyd_pressed[KEY_RCTRL] ) - shift_status |= KEY_CTRLED; - -#ifndef NDEBUG - if (keyd_pressed[KEY_DELETE]) - shift_status |=KEY_DEBUGGED; -#endif - - return shift_status; -} - -// Returns the number of seconds this key has been down since last call. -fix key_down_time(int scancode) -{ - fix time_down, time; - - event_poll(); - if ((scancode<0)|| (scancode>255)) return 0; - - if (!keyd_pressed[scancode]) { - time_down = key_data.keys[scancode].timehelddown; - key_data.keys[scancode].timehelddown = 0; - } else { - time = timer_get_fixed_seconds(); - time_down = time - key_data.keys[scancode].timewentdown; - key_data.keys[scancode].timewentdown = time; - } - - return time_down; -} - -unsigned int key_down_count(int scancode) -{ - int n; - event_poll(); - if ((scancode<0)|| (scancode>255)) return 0; - - n = key_data.keys[scancode].downcount; - key_data.keys[scancode].downcount = 0; - - return n; -} - -unsigned int key_up_count(int scancode) -{ - int n; - event_poll(); - if ((scancode<0)|| (scancode>255)) return 0; - - n = key_data.keys[scancode].upcount; - key_data.keys[scancode].upcount = 0; - - return n; -} - diff --git a/input/ggi/mouse.c b/input/ggi/mouse.c deleted file mode 100644 index 7bf97316..00000000 --- a/input/ggi/mouse.c +++ /dev/null @@ -1,158 +0,0 @@ -#include -#include -#include -#include -#include "fix.h" -#include "timer.h" -#include "event.h" -#include "mouse.h" - -struct mousebutton { - ubyte pressed; - fix time_went_down; - fix time_held_down; - uint num_downs; - uint num_ups; -}; - -#define MOUSE_MAX_BUTTONS 3 - -static struct mouseinfo { - struct mousebutton buttons[MOUSE_MAX_BUTTONS]; -//added on 10/17/98 by Hans de Goede for mouse functionality - int min_x, min_y; - int max_x, max_y; - int delta_x, delta_y; - int x,y; -} Mouse; - -void mouse_correct() -{ - if (Mouse.x < Mouse.min_x) - Mouse.x = Mouse.min_x; - else if (Mouse.x > Mouse.max_x) - Mouse.x = Mouse.max_x; - if (Mouse.y < Mouse.min_y) - Mouse.y = Mouse.min_y; - else if (Mouse.y > Mouse.max_y) - Mouse.y = Mouse.max_y; -} - -void mouse_handler_absolute(int x, int y) -{ - Mouse.delta_x += (x - Mouse.x); - Mouse.delta_y += (y - Mouse.y); - Mouse.x = x; - Mouse.y = y; -// mouse_correct(); -} - -void mouse_handler_relative(int x, int y) -{ - Mouse.delta_x += x; - Mouse.delta_y += y; - Mouse.x += x; - Mouse.y += y; -// mouse_correct(); -} - -void mouse_handler_button(int button, ubyte state) -{ - if (!Mouse.buttons[button].pressed && state) - { - Mouse.buttons[button].time_went_down = timer_get_fixed_seconds(); - Mouse.buttons[button].num_downs++; - } - else if (Mouse.buttons[button].pressed && !state) - { - Mouse.buttons[button].num_ups++; - } - - Mouse.buttons[button].pressed = state; -} - -void Mouse_close(void) -{ -} - -void Mouse_init(void) -{ - memset(&Mouse, 0, sizeof(Mouse)); -} - -int mouse_set_limits( int x1, int y1, int x2, int y2 ) -{ - Mouse.min_x = x1; - Mouse.max_x = x2; - Mouse.min_y = y1; - Mouse.max_y = y2; - return MOUSE_MAX_BUTTONS; -} - -void mouse_flush() // clears all mice events... -{ - Mouse.x = 0; - Mouse.y = 0; - Mouse.delta_x = 0; - Mouse.delta_y = 0; -} - -//======================================================================== -void mouse_get_pos( int *x, int *y) -{ - event_poll(); - *x = Mouse.x; - *y = Mouse.y; -} - -void mouse_get_delta( int *dx, int *dy ) -{ - event_poll(); - *dx = Mouse.delta_x; - *dy = Mouse.delta_y; - Mouse.delta_x = 0; - Mouse.delta_y = 0; -} - -int mouse_get_btns() -{ - ubyte buttons = 0; - int i; - event_poll(); - for (i = 0; i < MOUSE_MAX_BUTTONS; i++) - buttons |= (Mouse.buttons[i].pressed << i); - return buttons; -} - -void mouse_set_pos( int x, int y) -{ - Mouse.x = x; - Mouse.y = y; -} - -void mouse_get_cyberman_pos( int *x, int *y ) -{ -} - -// Returns how long this button has been down since last call. -fix mouse_button_down_time(int button) -{ - if (Mouse.buttons[button].pressed) - return (timer_get_fixed_seconds() - Mouse.buttons[button].time_went_down); - else - return 0; -} - -// Returns how many times this button has went down since last call -int mouse_button_down_count(int button) -{ - int count = Mouse.buttons[button].num_downs; - Mouse.buttons[button].num_downs = 0; - return count; -} - -// Returns 1 if this button is currently down -int mouse_button_state(int button) -{ - return Mouse.buttons[button].pressed; -} diff --git a/input/ggi_event.c b/input/ggi_event.c index c4d120b3..32bb9cfa 100644 --- a/input/ggi_event.c +++ b/input/ggi_event.c @@ -1,6 +1,18 @@ +/* + * $Source: /cvs/cvsroot/d2x/input/ggi_event.c,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 14:03:57 $ + * + * GGI Event related stuff + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include +#endif -#ifdef GGI_INPUT #include #include #include @@ -59,10 +71,10 @@ void event_poll() mouse_handler_relative(event.pmove.x, event.pmove.y); break; case evPtrButtonPress: - mouse_handler_button(event.pbutton.button, 1); + mouse_handler_button(event.pbutton.button - 1, 1); break; case evPtrButtonRelease: - mouse_handler_button(event.pbutton.button, 0); + mouse_handler_button(event.pbutton.button - 1, 0); break; } } @@ -70,8 +82,10 @@ void event_poll() void event_close() { +#ifndef GGI_VIDEO if (inputs) giiClose(inputs); +#endif giiExit(); } @@ -127,5 +141,3 @@ int event_init() } return 0; } - -#endif //GGI_INPUT diff --git a/input/ggi_init.c b/input/ggi_init.c index 80ccebc5..8c05267a 100644 --- a/input/ggi_init.c +++ b/input/ggi_init.c @@ -1,4 +1,18 @@ +/* + * $Source: /cvs/cvsroot/d2x/input/ggi_init.c,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 14:03:57 $ + * + * GGI Initialization + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include +#endif + #include #include #include "text.h" diff --git a/input/ggi_key.c b/input/ggi_key.c index 7be12fcb..19646800 100644 --- a/input/ggi_key.c +++ b/input/ggi_key.c @@ -1,5 +1,18 @@ +/* + * $Source: /cvs/cvsroot/d2x/input/ggi_key.c,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 14:03:57 $ + * + * GGI keyboard input support + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include -#ifdef GGI_INPUT +#endif + #include #include @@ -47,27 +60,7 @@ typedef struct keyboard { static /*volatile*/ keyboard key_data; -char * key_text[256] = { -"","ESC","1","2","3","4","5","6","7","8","9","0","-", -"=","BSPC","TAB","Q","W","E","R","T","Y","U","I","O", -"P","[","]","ƒ","LCTRL","A","S","D","F", -"G","H","J","K","L",";","'","`", -"LSHFT","\\","Z","X","C","V","B","N","M",",", -".","/","RSHFT","PAD*","LALT","SPC", -"CPSLK","F1","F2","F3","F4","F5","F6","F7","F8","F9", -"F10","NMLCK","SCLK","PAD7","PAD8","PAD9","PAD-", -"PAD4","PAD5","PAD6","PAD+","PAD1","PAD2","PAD3","PAD0", -"PAD.","","","","F11","F12","","","","","","","","","", -"","","","","","","","","","","","","","","","","","","","", -"","","","","","","","","","","","","","","","","","","","", -"","","","","","","","","","","","","","","","","","", -"PADƒ","RCTRL","","","","","","","","","","","","","", -"","","","","","","","","","","PAD/","","","RALT","", -"","","","","","","","","","","","","","HOME","‚","PGUP", -"","","","","","END","€","PGDN","INS", -"DEL","","","","","","","","","","","","","","","","","", -"","","","","","","","","","","","","","","","","","","","", -"","","","","","","" }; +char * key_text[256]; unsigned char ascii_table[128] = { 255, 255, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=',255,255, @@ -493,6 +486,3 @@ unsigned int key_up_count(int scancode) return n; } - - -#endif //GGI_INPUT diff --git a/input/ggi_mouse.c b/input/ggi_mouse.c index f580c49d..29cfe43b 100644 --- a/input/ggi_mouse.c +++ b/input/ggi_mouse.c @@ -1,5 +1,18 @@ +/* + * $Source: /cvs/cvsroot/d2x/input/ggi_mouse.c,v $ + * $Revision: 1.4 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 14:03:57 $ + * + * GGI mouse support + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include -#ifdef GGI_INPUT +#endif + #include #include #include @@ -81,13 +94,13 @@ void Mouse_init(void) memset(&Mouse, 0, sizeof(Mouse)); } -int mouse_set_limits( int x1, int y1, int x2, int y2 ) +void +mouse_set_limits( int x1, int y1, int x2, int y2 ) { Mouse.min_x = x1; Mouse.max_x = x2; Mouse.min_y = y1; Mouse.max_y = y2; - return MOUSE_MAX_BUTTONS; } void mouse_flush() // clears all mice events... @@ -157,5 +170,3 @@ int mouse_button_state(int button) { return Mouse.buttons[button].pressed; } - -#endif //GGI_INPUT diff --git a/input/linux/Makefile.am b/input/linux/Makefile.am index 711a38d9..7b92e00e 100644 --- a/input/linux/Makefile.am +++ b/input/linux/Makefile.am @@ -1,4 +1 @@ -noinst_LIBRARIES = libinputlinux.a -INCLUDES = -I$(top_srcdir)/includes -I$(top_srcdir)/main -Iinclude -I../sdl/include -libinputlinux_a_SOURCES = \ -joystick.c joydefs.c +SUBDIRS = include diff --git a/input/linux/Makefile.in b/input/linux/Makefile.in deleted file mode 100644 index 450157bb..00000000 --- a/input/linux/Makefile.in +++ /dev/null @@ -1,299 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# 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. - -# 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. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = ../.. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CFLAGS = @CFLAGS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NASM = @NASM@ -NASMFLAGS = @NASMFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -SDL_LIBS = @SDL_LIBS@ -VERSION = @VERSION@ - -noinst_LIBRARIES = libinputlinux.a -INCLUDES = -I$(top_srcdir)/includes -I$(top_srcdir)/main -Iinclude -I../sdl/include -libinputlinux_a_SOURCES = joystick.c joydefs.c - -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../../conf.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I../.. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -libinputlinux_a_LIBADD = -libinputlinux_a_OBJECTS = joystick.o joydefs.o -AR = ar -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -DEP_FILES = .deps/joydefs.P .deps/joystick.P -SOURCES = $(libinputlinux_a_SOURCES) -OBJECTS = $(libinputlinux_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu input/linux/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -.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: - -libinputlinux.a: $(libinputlinux_a_OBJECTS) $(libinputlinux_a_DEPENDENCIES) - -rm -f libinputlinux.a - $(AR) cru libinputlinux.a $(libinputlinux_a_OBJECTS) $(libinputlinux_a_LIBADD) - $(RANLIB) libinputlinux.a - -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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - 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 = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = input/linux - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu input/linux/Makefile - @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 - -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 - @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 -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -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-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-depend mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - 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-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags 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 \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -# 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/input/linux/include/Makefile.am b/input/linux/include/Makefile.am new file mode 100644 index 00000000..6c6d6ecc --- /dev/null +++ b/input/linux/include/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ +linux_joystick.h diff --git a/input/linux/include/joystick.h b/input/linux/include/joystick.h deleted file mode 100644 index e201d454..00000000 --- a/input/linux/include/joystick.h +++ /dev/null @@ -1,266 +0,0 @@ -#ifndef _LINUX_JOYSTICK_H -#define _LINUX_JOYSTICK_H - -/* - * /usr/include/linux/joystick.h Version 1.2 - * - * Copyright (C) 1996-1998 Vojtech Pavlik - */ - -#include -#include - -/* - * Version - */ - -#define JS_VERSION 0x01020a - -/* - * Types and constants for reading from /dev/js - */ - -#define JS_EVENT_BUTTON 0x01 /* button pressed/released */ -#define JS_EVENT_AXIS 0x02 /* joystick moved */ -#define JS_EVENT_INIT 0x80 /* initial state of device */ - -struct js_event { - __u32 time; /* event timestamp in miliseconds */ - __s16 value; /* value */ - __u8 type; /* event type */ - __u8 number; /* axis/button number */ -}; - -/* - * IOCTL commands for joystick driver - */ - -#define JSIOCGVERSION _IOR('j', 0x01, __u32) /* get driver version */ - -#define JSIOCGAXES _IOR('j', 0x11, __u8) /* get number of axes */ -#define JSIOCGBUTTONS _IOR('j', 0x12, __u8) /* get number of buttons */ -#define JSIOCGNAME(len) _IOC(_IOC_READ, 'j', 0x13, len) /* get identifier string */ - -#define JSIOCSCORR _IOW('j', 0x21, struct js_corr) /* set correction values */ -#define JSIOCGCORR _IOR('j', 0x22, struct js_corr) /* get correction values */ - -/* - * Types and constants for get/set correction - */ - -#define JS_CORR_NONE 0x00 /* returns raw values */ -#define JS_CORR_BROKEN 0x01 /* broken line */ - -struct js_corr { - __s32 coef[8]; - __s16 prec; - __u16 type; -}; - -/* - * v0.x compatibility definitions - */ - -#define JS_RETURN sizeof(struct JS_DATA_TYPE) -#define JS_TRUE 1 -#define JS_FALSE 0 -#define JS_X_0 0x01 -#define JS_Y_0 0x02 -#define JS_X_1 0x04 -#define JS_Y_1 0x08 -#define JS_MAX 2 - -#define JS_DEF_TIMEOUT 0x1300 -#define JS_DEF_CORR 0 -#define JS_DEF_TIMELIMIT 10L - -#define JS_SET_CAL 1 -#define JS_GET_CAL 2 -#define JS_SET_TIMEOUT 3 -#define JS_GET_TIMEOUT 4 -#define JS_SET_TIMELIMIT 5 -#define JS_GET_TIMELIMIT 6 -#define JS_GET_ALL 7 -#define JS_SET_ALL 8 - -struct JS_DATA_TYPE { - int buttons; - int x; - int y; -}; - -struct JS_DATA_SAVE_TYPE { - int JS_TIMEOUT; - int BUSY; - long JS_EXPIRETIME; - long JS_TIMELIMIT; - struct JS_DATA_TYPE JS_SAVE; - struct JS_DATA_TYPE JS_CORR; -}; - -/* - * Internal definitions - */ - -#ifdef __KERNEL__ - -#define JS_BUFF_SIZE 64 /* output buffer size */ - -#include - -#ifndef KERNEL_VERSION -#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -#endif - -#ifndef LINUX_VERSION_CODE -#error "You need to use at least 2.0 Linux kernel." -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,0,0) -#error "You need to use at least 2.0 Linux kernel." -#endif - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0) -#define JS_HAS_RDTSC (current_cpu_data.x86_capability & 0x10) -#include -#else -#ifdef MODULE -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,35) -#define JS_HAS_RDTSC (x86_capability & 0x10) -#else -#define JS_HAS_RDTSC 0 -#endif -#else -#define JS_HAS_RDTSC (x86_capability & 0x10) -#endif -#define __initdata -#define __init -#define MODULE_AUTHOR(x) -#define MODULE_PARM(x,y) -#define MODULE_SUPPORTED_DEVICE(x) -#define signal_pending(x) (((x)->signal) & ~((x)->blocked)) -#endif - -/* - * Parport stuff - */ - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0) -#define USE_PARPORT -#endif - -#ifdef USE_PARPORT -#include -#define JS_PAR_STATUS(y) parport_read_status(y->port) -#define JS_PAR_DATA_IN(y) parport_read_data(y->port) -#define JS_PAR_DATA_OUT(x,y) parport_write_data(y->port, x) -#define JS_PAR_CTRL_OUT(x,y) parport_write_control(y->port, x) -#else -#define JS_PAR_STATUS(y) inb(y+1) -#define JS_PAR_DATA_IN(y) inb(y) -#define JS_PAR_DATA_OUT(x,y) outb(x,y) -#define JS_PAR_CTRL_OUT(x,y) outb(x,y+2) -#endif - -#define JS_PAR_STATUS_INVERT (0x80) - -/* - * Internal types - */ - -struct js_dev; - -typedef int (*js_read_func)(void *info, int **axes, int **buttons); -typedef unsigned int (*js_time_func)(void); -typedef int (*js_delta_func)(unsigned int x, unsigned int y); -typedef int (*js_ops_func)(struct js_dev *dev); - -struct js_data { - int *axes; - int *buttons; -}; - -struct js_dev { - struct js_dev *next; - struct js_list *list; - struct js_port *port; - struct wait_queue *wait; - struct js_data cur; - struct js_data new; - struct js_corr *corr; - struct js_event buff[JS_BUFF_SIZE]; - js_ops_func open; - js_ops_func close; - int ahead; - int bhead; - int tail; - int num_axes; - int num_buttons; - char *name; -}; - -struct js_list { - struct js_list *next; - struct js_dev *dev; - int tail; - int startup; -}; - -struct js_port { - struct js_port *next; - struct js_port *prev; - js_read_func read; - struct js_dev **devs; - int **axes; - int **buttons; - struct js_corr **corr; - void *info; - int ndevs; -}; - -/* - * Sub-module interface - */ - -extern unsigned int js_time_speed; -extern js_time_func js_get_time; -extern js_delta_func js_delta; - -extern unsigned int js_time_speed_a; -extern js_time_func js_get_time_a; -extern js_delta_func js_delta_a; - -extern struct js_port *js_register_port(struct js_port *port, void *info, - int devs, int infos, js_read_func read); -extern struct js_port *js_unregister_port(struct js_port *port); - -extern int js_register_device(struct js_port *port, int number, int axes, - int buttons, char *name, js_ops_func open, js_ops_func close); -extern void js_unregister_device(struct js_dev *dev); - -/* - * Kernel interface - */ - -extern int js_init(void); -extern int js_am_init(void); -extern int js_an_init(void); -extern int js_as_init(void); -extern int js_console_init(void); -extern int js_db9_init(void); -extern int js_gr_init(void); -extern int js_l4_init(void); -extern int js_lt_init(void); -extern int js_sw_init(void); -extern int js_tm_init(void); - -extern void js_am_setup(char *str, int *ints); -extern void js_an_setup(char *str, int *ints); -extern void js_as_setup(char *str, int *ints); -extern void js_console_setup(char *str, int *ints); -extern void js_db9_setup(char *str, int *ints); -extern void js_l4_setup(char *str, int *ints); - -#endif /* __KERNEL__ */ - -#endif /* _LINUX_JOYSTICK_H */ diff --git a/input/linux/include/linux_joystick.h b/input/linux/include/linux_joystick.h new file mode 100644 index 00000000..a039aff0 --- /dev/null +++ b/input/linux/include/linux_joystick.h @@ -0,0 +1,43 @@ +#define MAX_AXES 32 + +typedef struct joystick_device { + int device_number; + int version; + int buffer; + char num_buttons; + char num_axes; +} joystick_device; + +typedef struct joystick_axis { + int value; + int min_val; + int center_val; + int max_val; + int joydev; +} joystick_axis; + +typedef struct joystick_button { + ubyte state; + ubyte last_state; +//changed 6/24/1999 to finally squish the timedown bug - Owen Evans + fix timedown; +//end changed - OE + ubyte downcount; + int num; + int joydev; +} joystick_button; + +extern int j_num_axes; +extern int j_num_buttons; + +extern joystick_device j_joystick[4]; +extern joystick_axis j_axis[MAX_AXES]; +extern joystick_button j_button[MAX_BUTTONS]; + +extern int j_Update_state (); +extern int j_Get_joydev_axis_number (int all_axis_number); +extern int j_Get_joydev_button_number (int all_button_number); + +extern void joy_set_min (int axis_number, int value); +extern void joy_set_center (int axis_number, int value); +extern void joy_set_max (int axis_number, int value); diff --git a/input/linux/joydefs.c b/input/linux/joydefs.c deleted file mode 100644 index 8e072e0d..00000000 --- a/input/linux/joydefs.c +++ /dev/null @@ -1,237 +0,0 @@ -/* -THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -*/ - -#include -#include -#include -#include - -#include "pstypes.h" -#include "mono.h" -#include "key.h" -#include "joy.h" -#include "timer.h" -#include "error.h" - -#include "inferno.h" -#include "game.h" -#include "object.h" -#include "player.h" - -#include "controls.h" -#include "joydefs.h" -//#include "victor.h" -#include "render.h" -#include "palette.h" -#include "newmenu.h" -#include "args.h" -#include "text.h" -#include "kconfig.h" -#include "digi.h" -#include "playsave.h" - -int joydefs_calibrate_flag = 0; - -//added 9/6/98 Matt Mueller - not needed at all in linux code but bunches -int Joy_is_Sidewinder=0;// of main/* stuff uses it -//end addition - -void joy_delay() -{ - //int t1 = TICKER + 19/4; // Wait 1/4 second... - //stop_time(); - //while( TICKER < t1 ); - //joy_flush(); - //start_time(); -} - - -int joycal_message( char * title, char * text ) -{ - int i; - newmenu_item m[2]; - m[0].type = NM_TYPE_TEXT; m[0].text = text; - m[1].type = NM_TYPE_MENU; m[1].text = TXT_OK; - i = newmenu_do( title, NULL, 2, m, NULL ); - if ( i < 0 ) - return 1; - return 0; -} - -extern int WriteConfigFile(); - -extern joystick_device j_joystick[4]; -extern joystick_axis j_axis[MAX_AXES]; -extern joystick_button j_button[MAX_BUTTONS]; - -void joydefs_calibrate() -{ - - int i; - int temp_values[MAX_AXES]; - char title[50]; - char text[256]; -//added/killed on 10/17/98 by Hans de Goede for joystick/mouse # fix -//-killed- int nsticks = 0; -//end this section kill - Hans - - joydefs_calibrate_flag = 0; - - if (!joy_present) { - nm_messagebox( NULL, 1, TXT_OK, TXT_NO_JOYSTICK ); - return; - } - - if (j_joystick[0].version) { - joycal_message ("No Calibration", "calibration not required for\njoystick v1.x"); - return; - } - - for (i = 0; i < j_num_axes; i += 2) { - sprintf (title, "js%d Calibration", j_axis[i].joydev); - - sprintf (text, "center joystick %d", j_axis[i].joydev); - joycal_message (title, text); - joystick_read_raw_axis (JOY_ALL_AXIS, temp_values); - j_axis[i].center_val = temp_values[i]; - j_axis[i + 1].center_val = temp_values[i + 1]; - - sprintf (text, "move joystick %d to the upper left", j_axis[i].joydev); - joycal_message (title, text); - joystick_read_raw_axis (JOY_ALL_AXIS, temp_values); - j_axis[i].min_val = temp_values[i]; - j_axis[i + 1].min_val = temp_values[i + 1]; - - sprintf (text, "move joystick %d to the lower right", j_axis[i].joydev); - joycal_message (title, text); - joystick_read_raw_axis (JOY_ALL_AXIS, temp_values); - j_axis[i].max_val = temp_values[i]; - j_axis[i + 1].max_val = temp_values[i + 1]; - - } - - WriteConfigFile (); -} - - -//char *control_text[CONTROL_MAX_TYPES] = { "Keyboard only", "Joystick", "Flightstick Pro", "Thrustmaster FCS", "Gravis Gamepad", "Mouse", "Cyberman" }; - -void joydef_menuset_1(int nitems, newmenu_item * items, int *last_key, int citem ) -{ - int i; - int oc_type = Config_control_type; - - nitems = nitems; - last_key = last_key; - citem = citem; - - for (i=0; i<3; i++ ) - if (items[i].value) Config_control_type = i; - -//added on 10/17/98 by Hans de Goede for joystick/mouse # fix - // remap mouse, since "Flightstick Pro", "Thrustmaster FCS" - // and "Gravis Gamepad" where removed from the options - if (Config_control_type == 2) Config_control_type = CONTROL_MOUSE; -//end this section addition - Hans - - if ( (oc_type != Config_control_type) && (Config_control_type == CONTROL_THRUSTMASTER_FCS ) ) { - nm_messagebox( TXT_IMPORTANT_NOTE, 1, TXT_OK, TXT_FCS ); - } - - if (oc_type != Config_control_type) { - switch (Config_control_type) { - // case CONTROL_NONE: - case CONTROL_JOYSTICK: - case CONTROL_FLIGHTSTICK_PRO: - case CONTROL_THRUSTMASTER_FCS: - case CONTROL_GRAVIS_GAMEPAD: - // case CONTROL_MOUSE: - // case CONTROL_CYBERMAN: - joydefs_calibrate_flag = 1; - } - kc_set_controls(); - } - -} - -extern ubyte kc_use_external_control; -extern ubyte kc_enable_external_control; -extern ubyte *kc_external_name; - -void joydefs_config() -{ -//added/changed/killed on 10/17/98 by Hans de Goede for joystick/mouse # fix -//-killed- char xtext[128]; -//-killed- int i, old_masks, masks; - newmenu_item m[13]; -//-killed- int i1=5; -//-killed- int nitems; -//-killed- -//-killed- do { -//-killed- nitems = 6; - int i, i1=5, j, nitems=7; -//end this section kill/change - Hans - - m[0].type = NM_TYPE_RADIO; m[0].text = "KEYBOARD"; m[0].value = 0; m[0].group = 0; - m[1].type = NM_TYPE_RADIO; m[1].text = "JOYSTICK"; m[1].value = 0; m[1].group = 0; - m[2].type = NM_TYPE_RADIO; m[2].text = "MOUSE"; m[2].value = 0; m[2].group = 0; - m[3].type = NM_TYPE_TEXT; m[3].text=""; - m[4].type = NM_TYPE_MENU; m[4].text="CUSTOMIZE ABOVE"; - m[5].type = NM_TYPE_MENU; m[5].text="CUSTOMIZE KEYBOARD"; -//added on 2/5/99 by Victor Rachels for D1X keys menu - m[6].type = NM_TYPE_MENU; m[6].text="CUSTOMIZE D1X KEYS"; -//end this section addition - VR - -//added/changed/killed on 10/17/98 by Hans de Goede for joystick/mouse # fix -//-killed- m[Config_control_type].value = 1; - - do { - - - i = Config_control_type; - if(i==CONTROL_MOUSE) i = 2; - m[i].value=1; -//end section - OE -//end this section change/addition - Hans - - i1 = newmenu_do1( NULL, TXT_CONTROLS, nitems, m, joydef_menuset_1, i1 ); - -//added 6-15-99 Owen Evans - for (j = 0; j <= 2; j++) - if (m[j].value) - Config_control_type = j; - i = Config_control_type; - if (Config_control_type == 2) - Config_control_type = CONTROL_MOUSE; -//end added - OE - - switch(i1) { - case 4: -//added/changed on 10/17/98 by Hans de Goede for joystick/mouse # fix -//-killed- kconfig(Config_control_type, m[Config_control_type].text); - kconfig (i, m[i].text); -//end this section change - Hans - break; - case 5: - kconfig(0, "KEYBOARD"); - break; -//added on 2/5/99 by Victor Rachels for D1X keys menu - case 6: - kconfig(3, "D1X KEYS"); - break; -//end this section addition - VR - } - - } while(i1>-1); - -} diff --git a/input/linux/joystick.c b/input/linux/joystick.c deleted file mode 100644 index 6c9a1ee0..00000000 --- a/input/linux/joystick.c +++ /dev/null @@ -1,376 +0,0 @@ -#include -#include -#include -//#include "joystick.h" -#include -#include -#include - -#include "timer.h" -#include "pstypes.h" -#include "mono.h" -#include "joy.h" - -char joy_installed = 0; -char joy_present = 0; - -joystick_device j_joystick[4]; -joystick_axis j_axis[MAX_AXES]; -joystick_button j_button[MAX_BUTTONS]; - -int j_num_axes = 0, j_num_buttons = 0; -int timer_rate; - -int j_axes_in_sticks[4]; /* number of axes in the first [x] sticks */ -int j_buttons_in_sticks[4]; /* number of buttons in the first [x] sticks */ - -int joy_deadzone = 0; - -int j_Get_joydev_axis_number (int all_axis_number) { - int i, joy_axis_number = all_axis_number; - - for (i = 0; i < j_axis[all_axis_number].joydev; i++) { - joy_axis_number -= j_joystick[i].num_axes; - } - - return joy_axis_number; -} - - -int j_Get_joydev_button_number (int all_button_number) { - int i, joy_button_number = all_button_number; - - for (i = 0; i < j_button[all_button_number].joydev; i++) { - joy_button_number -= j_joystick[i].num_buttons; - } - - return joy_button_number; -} - - -int j_Update_state () { -/* int num_processed = 0, i; - struct js_event current_event; - struct JS_DATA_TYPE joy_data; - - for (i = 0; i < j_num_buttons; i++) { - //changed 6/24/1999 to finally squish the timedown bug - Owen Evans - if (j_button[i].state != j_button[i].last_state) { - if (j_button[i].state) { - j_button[i].downcount++; - j_button[i].timedown = timer_get_fixed_seconds(); - } - } - //end changed - OE - j_button[i].last_state = j_button[i].state; - } - - for (i = 0; i < 4; i++) { - if (j_joystick[i].buffer >= 0) { - if (j_joystick[i].version) { - while (read (j_joystick[i].buffer, ¤t_event, sizeof (struct js_event)) > 0) { - num_processed++; - switch (current_event.type & ~JS_EVENT_INIT) { - case JS_EVENT_AXIS: - j_axis[j_axes_in_sticks[i] + current_event.number].value = current_event.value; - break; - case JS_EVENT_BUTTON: - j_button[j_buttons_in_sticks[i] + current_event.number].state = current_event.value; - break; - } - } - } else { - read (j_joystick[i].buffer, &joy_data, JS_RETURN); - j_axis[j_axes_in_sticks[i] + 0].value = joy_data.x; - j_axis[j_axes_in_sticks[i] + 1].value = joy_data.y; - j_button[j_buttons_in_sticks[i] + 0].state = (joy_data.buttons & 0x01); - j_button[j_buttons_in_sticks[i] + 1].state = (joy_data.buttons & 0x02) >> 1; - } - } - } - - return num_processed;*/ - return 0; -} - - -void joy_set_cal_vals(int *axis_min, int *axis_center, int *axis_max) { - int i; - - for (i = 0; i < 4; i++) { - j_axis[i].center_val = axis_center[i]; - j_axis[i].min_val = axis_min[i]; - j_axis[i].max_val = axis_max[i]; - } -} - - -void joy_get_cal_vals(int *axis_min, int *axis_center, int *axis_max) { - int i; - - //edited 05/18/99 Matt Mueller - we should return all axes instead of j_num_axes, since they are all given to us in joy_set_cal_vals ( and because checker complains :) - for (i = 0; i < 4; i++) { - //end edit -MM - axis_center[i] = j_axis[i].center_val; - axis_min[i] = j_axis[i].min_val; - axis_max[i] = j_axis[i].max_val; - } -} - - -void joy_set_min (int axis_number, int value) { - j_axis[axis_number].min_val = value; -} - - -void joy_set_center (int axis_number, int value) { - j_axis[axis_number].center_val = value; -} - - -void joy_set_max (int axis_number, int value) { - j_axis[axis_number].max_val = value; -} - - -ubyte joy_get_present_mask () { - return 1; -} - - -void joy_set_timer_rate (int max_value) { - timer_rate = max_value; -} - - -int joy_get_timer_rate () { - return timer_rate; -} - - -void joy_flush () { - int i; - - if (!joy_installed) return; - - for (i = 0; i < j_num_buttons; i++) { - j_button[i].timedown = 0; - j_button[i].downcount = 0; - } - -} - - -ubyte joystick_read_raw_axis (ubyte mask, int *axes) { - int i; - - j_Update_state(); - - for (i = 0; i <= j_num_axes; i++) { - axes[i] = j_axis[i].value; - } - - return 0; -} - - -/* joy_init () is pretty huge, a bit klunky, and by no means pretty. But who cares? It does the job and it's only run once. */ - - -int joy_init () { - int i, j; - - if (joy_installed) return 0; - joy_flush (); - - if (!joy_installed) { - -// printf ("Initializing joystick... "); - - j_joystick[0].buffer = open ("/dev/js0", O_NONBLOCK); - j_joystick[1].buffer = open ("/dev/js1", O_NONBLOCK); - j_joystick[2].buffer = open ("/dev/js2", O_NONBLOCK); - j_joystick[3].buffer = open ("/dev/js3", O_NONBLOCK); - - if (j_joystick[0].buffer >= 0 || j_joystick[1].buffer >= 0 || j_joystick[2].buffer >= 0 || j_joystick[3].buffer >= 0) { -// printf ("found: "); - - for (i = 0; i < 4; i++) { - if (j_joystick[i].buffer >= 0) { - /* - ioctl (j_joystick[i].buffer, JSIOCGAXES, &j_joystick[i].num_axes); - ioctl (j_joystick[i].buffer, JSIOCGBUTTONS, &j_joystick[i].num_buttons); - ioctl (j_joystick[i].buffer, JSIOCGVERSION, &j_joystick[i].version); -*/ - if (!j_joystick[i].version) { - j_joystick[i].num_axes = 2; - j_joystick[i].num_buttons = 2; -// printf ("js%d (v0.x) " , i); - } else { -// printf ("js%d (v%d.%d.%d) ", i, (j_joystick[i].version & 0xff0000) >> 16, (j_joystick[i].version & 0xff00) >> 8, j_joystick[i].version & 0xff); - } - - for (j = j_num_axes; j < (j_num_axes + j_joystick[i].num_axes); j++) { - j_axis[j].joydev = i; - if (j_joystick[i].version) { - j_axis[j].center_val = 0; - j_axis[j].max_val = 32767; - j_axis[j].min_val = -32767; - } - } - for (j = j_num_buttons; j < (j_num_buttons + j_joystick[i].num_buttons); j++) { - j_button[j].joydev = i; - } - - j_num_axes += j_joystick[i].num_axes; - j_num_buttons += j_joystick[i].num_buttons; - - } else { - j_joystick[i].num_buttons = 0; - j_joystick[i].num_axes = 0; - } - - for (j = 0; j < i; j++) { - j_axes_in_sticks[i] += j_joystick[j].num_axes; - j_buttons_in_sticks[i] += j_joystick[j].num_buttons; - } - } - } else { -// printf ("no joysticks found\n"); - return 0; - } - -// printf ("\n"); - - if (j_num_axes > MAX_AXES) - j_num_axes = MAX_AXES; - if (j_num_buttons > MAX_BUTTONS) - j_num_buttons = MAX_BUTTONS; - - joy_present = 1; - joy_installed = 1; - return 1; - } - - return 1; -} - - -void joy_close() { - int i; - - if (!joy_installed) return; - - for (i = 0; i < 4; i++) { - if (j_joystick[i].buffer>=0) { - printf ("closing js%d\n", i); - close (j_joystick[i].buffer); - } - j_joystick[i].buffer=-1; - } - - joy_present=0; - joy_installed=0; -} - - -void joy_set_cen() { -} - - -int joy_get_scaled_reading(int raw, int axis_num) -{ - int d, x; - - raw -= j_axis[axis_num].center_val; - - if (raw < 0) - d = j_axis[axis_num].center_val - j_axis[axis_num].min_val; - else if (raw > 0) - d = j_axis[axis_num].max_val - j_axis[axis_num].center_val; - else - d = 0; - - if (d) - x = ((raw << 7) / d); - else - x = 0; - - if ( x < -128 ) - x = -128; - if ( x > 127 ) - x = 127; - -//added on 4/13/99 by Victor Rachels to add deadzone control - d = (joy_deadzone) * 6; - if ((x > (-1*d)) && (x < d)) - x = 0; -//end this section addition -VR - - return x; -} - - -void joy_get_pos(int *x, int *y) { - int axis[MAX_AXES]; - - if ((!joy_installed)||(!joy_present)) { *x=*y=0; return; } - - joystick_read_raw_axis (JOY_ALL_AXIS, axis); - - *x = joy_get_scaled_reading( axis[0], 0 ); - *y = joy_get_scaled_reading( axis[1], 1 ); -} - - -int joy_get_btns () { - return 0; -} - - -int joy_get_button_state (int btn) { - if(btn >= j_num_buttons) - return 0; - j_Update_state (); - - return j_button[btn].state; -} - - -int joy_get_button_down_cnt (int btn) { - int downcount; - - j_Update_state (); - - downcount = j_button[btn].downcount; - j_button[btn].downcount = 0; - - return downcount; -} - - -//changed 6/24/99 to finally squish the timedown bug - Owen Evans -fix joy_get_button_down_time(int btn) { - fix downtime; - j_Update_state (); - - if (j_button[btn].state) { - downtime = timer_get_fixed_seconds() - j_button[btn].timedown; - j_button[btn].timedown = timer_get_fixed_seconds(); - } else { - downtime = 0; - } - - return downtime; -} -//end changed - OE - -void joy_poll() { - -} - - -void joy_set_slow_reading(int flag) { - -} - diff --git a/input/linux_joydefs.c b/input/linux_joydefs.c index 15537358..df4fa3e3 100644 --- a/input/linux_joydefs.c +++ b/input/linux_joydefs.c @@ -11,8 +11,21 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +/* + * $Source: /cvs/cvsroot/d2x/input/linux_joydefs.c,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 14:03:57 $ + * + * Linux joystick support + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include -#ifdef __ENV_LINUX__ +#endif + #include #include #include @@ -41,6 +54,8 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "digi.h" #include "playsave.h" +#include "linux_joystick.h" + int joydefs_calibrate_flag = 0; //added 9/6/98 Matt Mueller - not needed at all in linux code but bunches @@ -236,5 +251,3 @@ void joydefs_config() } while(i1>-1); } - -#endif //__ENV_LINUX__ diff --git a/input/linux_joystick.c b/input/linux_joystick.c index c6748ea5..e0daa87f 100644 --- a/input/linux_joystick.c +++ b/input/linux_joystick.c @@ -1,9 +1,21 @@ +/* + * $Source: /cvs/cvsroot/d2x/input/linux_joystick.c,v $ + * $Revision: 1.4 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 14:03:57 $ + * + * Linux joystick support + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include +#endif -#ifdef __ENV_LINUX__ #include #include -//#include "joystick.h" +#include #include #include #include @@ -13,6 +25,8 @@ #include "mono.h" #include "joy.h" +#include "linux_joystick.h" + char joy_installed = 0; char joy_present = 0; @@ -51,7 +65,7 @@ int j_Get_joydev_button_number (int all_button_number) { int j_Update_state () { -/* int num_processed = 0, i; + int num_processed = 0, i; struct js_event current_event; struct JS_DATA_TYPE joy_data; @@ -91,8 +105,7 @@ int j_Update_state () { } } - return num_processed;*/ - return 0; + return num_processed; } @@ -168,7 +181,7 @@ ubyte joystick_read_raw_axis (ubyte mask, int *axes) { j_Update_state(); - for (i = 0; i <= j_num_axes; i++) { + for (i = 0; i < j_num_axes; i++) { axes[i] = j_axis[i].value; } @@ -187,7 +200,7 @@ int joy_init () { if (!joy_installed) { -// printf ("Initializing joystick... "); + printf ("Initializing joystick... "); j_joystick[0].buffer = open ("/dev/js0", O_NONBLOCK); j_joystick[1].buffer = open ("/dev/js1", O_NONBLOCK); @@ -195,21 +208,23 @@ int joy_init () { j_joystick[3].buffer = open ("/dev/js3", O_NONBLOCK); if (j_joystick[0].buffer >= 0 || j_joystick[1].buffer >= 0 || j_joystick[2].buffer >= 0 || j_joystick[3].buffer >= 0) { -// printf ("found: "); + printf ("found: "); for (i = 0; i < 4; i++) { if (j_joystick[i].buffer >= 0) { - /* ioctl (j_joystick[i].buffer, JSIOCGAXES, &j_joystick[i].num_axes); ioctl (j_joystick[i].buffer, JSIOCGBUTTONS, &j_joystick[i].num_buttons); ioctl (j_joystick[i].buffer, JSIOCGVERSION, &j_joystick[i].version); -*/ if (!j_joystick[i].version) { j_joystick[i].num_axes = 2; j_joystick[i].num_buttons = 2; -// printf ("js%d (v0.x) " , i); + printf ("js%d (v0.x) " , i); } else { -// printf ("js%d (v%d.%d.%d) ", i, (j_joystick[i].version & 0xff0000) >> 16, (j_joystick[i].version & 0xff00) >> 8, j_joystick[i].version & 0xff); + printf ("js%d (v%d.%d.%d) ", + i, + (j_joystick[i].version & 0xff0000) >> 16, + (j_joystick[i].version & 0xff00) >> 8, + j_joystick[i].version & 0xff); } for (j = j_num_axes; j < (j_num_axes + j_joystick[i].num_axes); j++) { @@ -238,11 +253,11 @@ int joy_init () { } } } else { -// printf ("no joysticks found\n"); + printf ("no joysticks found\n"); return 0; } -// printf ("\n"); + printf ("\n"); if (j_num_axes > MAX_AXES) j_num_axes = MAX_AXES; @@ -375,5 +390,3 @@ void joy_poll() { void joy_set_slow_reading(int flag) { } - -#endif // __ENV_LINUX__ diff --git a/input/sdl/Makefile.am b/input/sdl/Makefile.am deleted file mode 100644 index 4e64b952..00000000 --- a/input/sdl/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -noinst_LIBRARIES = libinputsdl.a -INCLUDES = -I$(top_srcdir)/includes -I$(top_srcdir)/main -Iinclude -libinputsdl_a_SOURCES = \ -event.c key.c mouse.c diff --git a/input/sdl/Makefile.in b/input/sdl/Makefile.in deleted file mode 100644 index 21b1036b..00000000 --- a/input/sdl/Makefile.in +++ /dev/null @@ -1,299 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# 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. - -# 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. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = ../.. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CFLAGS = @CFLAGS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NASM = @NASM@ -NASMFLAGS = @NASMFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -SDL_LIBS = @SDL_LIBS@ -VERSION = @VERSION@ - -noinst_LIBRARIES = libinputsdl.a -INCLUDES = -I$(top_srcdir)/includes -I$(top_srcdir)/main -Iinclude -libinputsdl_a_SOURCES = event.c key.c mouse.c - -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../../conf.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I../.. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -libinputsdl_a_LIBADD = -libinputsdl_a_OBJECTS = event.o key.o mouse.o -AR = ar -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -DEP_FILES = .deps/event.P .deps/key.P .deps/mouse.P -SOURCES = $(libinputsdl_a_SOURCES) -OBJECTS = $(libinputsdl_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu input/sdl/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -.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: - -libinputsdl.a: $(libinputsdl_a_OBJECTS) $(libinputsdl_a_DEPENDENCIES) - -rm -f libinputsdl.a - $(AR) cru libinputsdl.a $(libinputsdl_a_OBJECTS) $(libinputsdl_a_LIBADD) - $(RANLIB) libinputsdl.a - -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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - 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 = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = input/sdl - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu input/sdl/Makefile - @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 - -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 - @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 -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -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-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-depend mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - 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-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags 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 \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -# 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/input/sdl/event.c b/input/sdl/event.c deleted file mode 100644 index 15c72690..00000000 --- a/input/sdl/event.c +++ /dev/null @@ -1,54 +0,0 @@ -// SDL Event related stuff - -#include -#include -#include - -#include - -extern void key_handler(SDL_KeyboardEvent *event); -//added on 10/17/98 by Hans de Goede for mouse functionality -extern void mouse_button_handler(SDL_MouseButtonEvent *mbe); -extern void mouse_motion_handler(SDL_MouseMotionEvent *mme); -//end this section addition - Hans - -static int initialised=0; - -void event_poll() -{ - SDL_Event event; - while (SDL_PollEvent(&event)) - { -// if( (event.type == SDL_KEYEVENT) { -//added/changed on 10/17/98 by Hans de Goede for mouse functionality -//-killed- if( (event.type == SDL_KEYDOWN) || (event.type == SDL_KEYUP) ) { - switch(event.type) - { - case SDL_KEYDOWN: - case SDL_KEYUP: - key_handler((SDL_KeyboardEvent *)&event); - break; - case SDL_MOUSEBUTTONDOWN: - case SDL_MOUSEBUTTONUP: - mouse_button_handler((SDL_MouseButtonEvent *)&event); - break; - case SDL_MOUSEMOTION: - mouse_motion_handler((SDL_MouseMotionEvent *)&event); - break; -//-killed- return; -//end this section addition/change - Hans - case SDL_QUIT: { -// void quit_request(); -// quit_request(); - } break; - } - } -} - -int event_init() -{ - // We should now be active and responding to events. - initialised = 1; - - return 0; -} diff --git a/input/sdl/include/event.h b/input/sdl/include/event.h deleted file mode 100644 index 1aeaedbd..00000000 --- a/input/sdl/include/event.h +++ /dev/null @@ -1,9 +0,0 @@ -// Event header file - -#ifndef _EVENT_H -#define _EVENT_H - -int event_init(); -void event_poll(); - -#endif diff --git a/input/sdl/include/key.h b/input/sdl/include/key.h deleted file mode 100644 index 8974cc84..00000000 --- a/input/sdl/include/key.h +++ /dev/null @@ -1,271 +0,0 @@ -/* -THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -*/ -/* - * $Source: /cvs/cvsroot/d2x/input/sdl/include/key.h,v $ - * $Revision: 1.1.1.1 $ - * $Author: bradleyb $ - * $Date: 2001-01-19 03:29:59 $ - * - * Header for keyboard functions - * - * $Log: not supported by cvs2svn $ - * Revision 1.1.1.1 1999/06/14 22:02:01 donut - * Import of d1x 1.37 source. - * - * Revision 1.19 1994/10/24 13:58:12 john - * Hacked in support for pause key onto code 0x61. - * - * Revision 1.18 1994/10/21 15:17:10 john - * Added KEY_PRINT_SCREEN - * - * Revision 1.17 1994/08/31 12:22:13 john - * Added KEY_DEBUGGED - * - * Revision 1.16 1994/08/24 18:53:50 john - * Made Cyberman read like normal mouse; added dpmi module; moved - * mouse from assembly to c. Made mouse buttons return time_down. - * - * Revision 1.15 1994/08/18 14:56:16 john - * *** empty log message *** - * - * Revision 1.14 1994/08/08 10:43:24 john - * Recorded when a key was pressed for key_inkey_time. - * - * Revision 1.13 1994/06/17 17:17:28 john - * Added keyd_time_last_key_was_pressed or something like that. - * - * Revision 1.12 1994/04/29 12:14:19 john - * Locked all memory used during interrupts so that program - * won't hang when using virtual memory. - * - * Revision 1.11 1994/02/17 15:57:14 john - * Changed key libary to C. - * - * Revision 1.10 1994/01/31 08:34:09 john - * Fixed reversed lshift/rshift keys. - * - * Revision 1.9 1994/01/18 10:58:17 john - * *** empty log message *** - * - * Revision 1.8 1993/10/16 19:24:43 matt - * Added new function key_clear_times() & key_clear_counts() - * - * Revision 1.7 1993/10/15 10:17:09 john - * added keyd_last_key_pressed and released for use with recorder. - * - * Revision 1.6 1993/10/06 16:20:37 john - * fixed down arrow bug - * - * Revision 1.5 1993/10/04 13:26:42 john - * changed the #defines for scan codes. - * - * Revision 1.4 1993/09/28 11:35:20 john - * added key_peekkey - * - * Revision 1.3 1993/09/20 18:36:43 john - * *** empty log message *** - * - * Revision 1.1 1993/07/10 13:10:39 matt - * Initial revision - * - * - */ - -#ifndef _KEY_H -#define _KEY_H - -#include "fix.h" -#include "pstypes.h" -#include // For 'toupper' - -//========================================================================== -// This installs the int9 vector and initializes the keyboard in buffered -// ASCII mode. key_close simply undoes that. -extern void key_init(); -extern void key_close(); - -//========================================================================== -// These are configuration parameters to setup how the buffer works. -// set keyd_buffer_type to 0 for no key buffering. -// set it to 1 and it will buffer scancodes. -extern unsigned char keyd_buffer_type; -extern unsigned char keyd_repeat; // 1=allow repeating, 0=dont allow repeat - -// keyd_editor_mode... 0=game mode, 1=editor mode. -// Editor mode makes key_down_time always return 0 if modifiers are down. -extern unsigned char keyd_editor_mode; - -// Time in seconds when last key was pressed... -extern volatile int keyd_time_when_last_pressed; - -//========================================================================== -// These are the "buffered" keypress routines. Use them by setting the -// "keyd_buffer_type" variable. - -extern void key_flush(); // Clears the 256 char buffer -extern int key_checkch(); // Returns 1 if a char is waiting -extern int key_getch(); // Gets key if one waiting other waits for one. -extern int key_inkey(); // Gets key if one, other returns 0. -extern int key_inkey_time(fix *time); // Same as inkey, but returns the time the key was pressed down. -extern int key_peekkey(); // Same as inkey, but doesn't remove key from buffer. - -extern unsigned char key_to_ascii(int keycode ); -extern char *key_name(int keycode); // Convert keycode to the name of the key - -extern void key_debug(); // Does an INT3 - -//========================================================================== -// These are the unbuffered routines. Index by the keyboard scancode. - -// Set to 1 if the key is currently down, else 0 -extern volatile unsigned char keyd_pressed[]; -extern volatile unsigned char keyd_last_pressed; -extern volatile unsigned char keyd_last_released; - -// Returns the seconds this key has been down since last call. -extern fix key_down_time(int scancode); - -// Returns number of times key has went from up to down since last call. -extern unsigned int key_down_count(int scancode); - -// Returns number of times key has went from down to up since last call. -extern unsigned int key_up_count(int scancode); - -// Clears the times & counts used by the above functions -// Took out... use key_flush(); -//void key_clear_times(); -//void key_clear_counts(); - -extern char * key_text[256]; - -#define KEY_SHIFTED 0x100 -#define KEY_ALTED 0x200 -#define KEY_CTRLED 0x400 -#define KEY_DEBUGGED 0x800 - -#define KEY_0 0x0B -#define KEY_1 0x02 -#define KEY_2 0x03 -#define KEY_3 0x04 -#define KEY_4 0x05 -#define KEY_5 0x06 -#define KEY_6 0x07 -#define KEY_7 0x08 -#define KEY_8 0x09 -#define KEY_9 0x0A - -#define KEY_A 0x1E -#define KEY_B 0x30 -#define KEY_C 0x2E -#define KEY_D 0x20 -#define KEY_E 0x12 -#define KEY_F 0x21 -#define KEY_G 0x22 -#define KEY_H 0x23 -#define KEY_I 0x17 -#define KEY_J 0x24 -#define KEY_K 0x25 -#define KEY_L 0x26 -#define KEY_M 0x32 -#define KEY_N 0x31 -#define KEY_O 0x18 -#define KEY_P 0x19 -#define KEY_Q 0x10 -#define KEY_R 0x13 -#define KEY_S 0x1F -#define KEY_T 0x14 -#define KEY_U 0x16 -#define KEY_V 0x2F -#define KEY_W 0x11 -#define KEY_X 0x2D -#define KEY_Y 0x15 -#define KEY_Z 0x2C - -#define KEY_MINUS 0x0C -#define KEY_EQUAL 0x0D -#define KEY_DIVIDE 0x35 -#define KEY_SLASH 0x2B -#define KEY_COMMA 0x33 -#define KEY_PERIOD 0x34 -#define KEY_SEMICOL 0x27 - -#define KEY_LBRACKET 0x1A -#define KEY_RBRACKET 0x1B - -#define KEY_RAPOSTRO 0x28 -#define KEY_LAPOSTRO 0x29 - -#define KEY_ESC 0x01 -#define KEY_ENTER 0x1C -#define KEY_BACKSP 0x0E -#define KEY_TAB 0x0F -#define KEY_SPACEBAR 0x39 - -#define KEY_NUMLOCK 0x45 -#define KEY_SCROLLOCK 0x46 -#define KEY_CAPSLOCK 0x3A - -#define KEY_LSHIFT 0x2A -#define KEY_RSHIFT 0x36 - -#define KEY_LALT 0x38 -#define KEY_RALT 0xB8 - -#define KEY_LCTRL 0x1D -#define KEY_RCTRL 0x9D - -#define KEY_F1 0x3B -#define KEY_F2 0x3C -#define KEY_F3 0x3D -#define KEY_F4 0x3E -#define KEY_F5 0x3F -#define KEY_F6 0x40 -#define KEY_F7 0x41 -#define KEY_F8 0x42 -#define KEY_F9 0x43 -#define KEY_F10 0x44 -#define KEY_F11 0x57 -#define KEY_F12 0x58 - -#define KEY_PAD0 0x52 -#define KEY_PAD1 0x4F -#define KEY_PAD2 0x50 -#define KEY_PAD3 0x51 -#define KEY_PAD4 0x4B -#define KEY_PAD5 0x4C -#define KEY_PAD6 0x4D -#define KEY_PAD7 0x47 -#define KEY_PAD8 0x48 -#define KEY_PAD9 0x49 -#define KEY_PADMINUS 0x4A -#define KEY_PADPLUS 0x4E -#define KEY_PADPERIOD 0x53 -#define KEY_PADDIVIDE 0xB5 -#define KEY_PADMULTIPLY 0x37 -#define KEY_PADENTER 0x9C - -#define KEY_INSERT 0xD2 -#define KEY_HOME 0xC7 -#define KEY_PAGEUP 0xC9 -#define KEY_DELETE 0xD3 -#define KEY_END 0xCF -#define KEY_PAGEDOWN 0xD1 -#define KEY_UP 0xC8 -#define KEY_DOWN 0xD0 -#define KEY_LEFT 0xCB -#define KEY_RIGHT 0xCD - -#define KEY_PRINT_SCREEN 0xB7 -#define KEY_PAUSE 0x61 - -#endif diff --git a/input/sdl/include/mouse.h b/input/sdl/include/mouse.h deleted file mode 100644 index 24518a8d..00000000 --- a/input/sdl/include/mouse.h +++ /dev/null @@ -1,127 +0,0 @@ -/* -THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX -SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO -END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A -ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS -IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS -SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE -FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE -CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. -COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. -*/ -/* - * $Source: /cvs/cvsroot/d2x/input/sdl/include/mouse.h,v $ - * $Revision: 1.1.1.1 $ - * $Author: bradleyb $ - * $Date: 2001-01-19 03:29:59 $ - * - * Header for mouse functions - * - * $Log: not supported by cvs2svn $ - * Revision 1.1.1.1 1999/06/14 22:02:02 donut - * Import of d1x 1.37 source. - * - * Revision 1.10 1995/02/02 10:22:29 john - * Added cyberman init parameter. - * - * Revision 1.9 1994/11/18 23:18:09 john - * Changed some shorts to ints. - * - * Revision 1.8 1994/09/13 12:33:49 john - * Added functions to get down count and state. - * - * Revision 1.7 1994/08/29 20:52:20 john - * Added better cyberman support; also, joystick calibration - * value return funcctiionn, - * - * Revision 1.6 1994/08/24 17:54:35 john - * *** empty log message *** - * - * Revision 1.5 1994/08/24 17:51:43 john - * Added transparent cyberman support - * - * Revision 1.4 1993/07/27 09:32:22 john - * *** empty log message *** - * - * Revision 1.3 1993/07/26 10:46:44 john - * added definition for mouse_set_pos - * - * Revision 1.2 1993/07/22 13:07:59 john - * added header for mousesetlimts - * - * Revision 1.1 1993/07/10 13:10:40 matt - * Initial revision - * - * - */ - -#ifndef MOUSE_H -#define MOUSE_H - -#include "pstypes.h" -#include "fix.h" - -#define MOUSE_MAX_BUTTONS 8 - -#define MB_LEFT 0 -#define MB_RIGHT 1 -#define MB_MIDDLE 2 -#define MB_Z_UP 3 -#define MB_Z_DOWN 4 -#define MB_PITCH_BACKWARD 5 -#define MB_PITCH_FORWARD 6 -#define MB_BANK_LEFT 7 -#define MB_BANK_RIGHT 8 -#define MB_HEAD_LEFT 9 -#define MB_HEAD_RIGHT 10 - -#define MOUSE_LBTN 1 -#define MOUSE_RBTN 2 -#define MOUSE_MBTN 4 - -#undef NOMOUSE -#ifndef NOMOUSE - -//======================================================================== -// Check for mouse driver, reset driver if installed. returns number of -// buttons if driver is present. - -extern int mouse_set_limits( int x1, int y1, int x2, int y2 ); -extern void mouse_flush(); // clears all mice events... - -//======================================================================== -extern void mouse_get_pos( int *x, int *y); -extern void mouse_get_delta( int *dx, int *dy ); -extern int mouse_get_btns(); -extern void mouse_set_pos( int x, int y); -extern void mouse_get_cyberman_pos( int *x, int *y ); - -// Returns how long this button has been down since last call. -extern fix mouse_button_down_time(int button); - -// Returns how many times this button has went down since last call. -extern int mouse_button_down_count(int button); - -// Returns 1 if this button is currently down -extern int mouse_button_state(int button); - -#else -// 'Neutered' functions... :-) -#define mouse_init(a) -1 -#define mouse_set_limits(a,b,c,d) -1 -#define mouse_flush() -#define mouse_close() -#define mouse_get_pos(a,b) -#define mouse_get_delta(a,b) -#define mouse_get_btns() 0 -#define mouse_set_pos(a,b) -#define mouse_get_cyberman_pos(a,b) -#define mouse_button_down_time(a) 0 -#define mouse_button_down_count(a) 0 -#define mouse_button_state(a) 0 - -#endif - -#endif - diff --git a/input/sdl/key.c b/input/sdl/key.c deleted file mode 100644 index 9eb590c5..00000000 --- a/input/sdl/key.c +++ /dev/null @@ -1,616 +0,0 @@ -// SDL keyboard input support - -#include -#include -#include - -#include - -#include "event.h" -#include "error.h" -#include "key.h" -#include "timer.h" - -//added on 9/3/98 by Matt Mueller to free some cpu instead of hogging during menus and such -#include "d_delay.h" -//end this section addition - Matt Mueller - -#define KEY_BUFFER_SIZE 16 - -static unsigned char Installed = 0; - -//-------- Variable accessed by outside functions --------- -unsigned char keyd_buffer_type; // 0=No buffer, 1=buffer ASCII, 2=buffer scans -unsigned char keyd_repeat; -unsigned char keyd_editor_mode; -volatile unsigned char keyd_last_pressed; -volatile unsigned char keyd_last_released; -volatile unsigned char keyd_pressed[256]; -volatile int keyd_time_when_last_pressed; - -typedef struct Key_info { - ubyte state; // state of key 1 == down, 0 == up - ubyte last_state; // previous state of key - int counter; // incremented each time key is down in handler - fix timewentdown; // simple counter incremented each time in interrupt and key is down - fix timehelddown; // counter to tell how long key is down -- gets reset to 0 by key routines - ubyte downcount; // number of key counts key was down - ubyte upcount; // number of times key was released -} Key_info; - -typedef struct keyboard { - unsigned short keybuffer[KEY_BUFFER_SIZE]; - Key_info keys[256]; - fix time_pressed[KEY_BUFFER_SIZE]; - unsigned int keyhead, keytail; -} keyboard; - -static keyboard key_data; - -typedef struct key_props { - char *key_text; - unsigned char ascii_value; - unsigned char shifted_ascii_value; - SDLKey sym; -} key_props; - -key_props key_properties[256] = { -{ "", 255, 255, -1 }, -{ "ESC", 255, 255, SDLK_ESCAPE }, -{ "1", '1', '!', SDLK_1 }, -{ "2", '2', '@', SDLK_2 }, -{ "3", '3', '#', SDLK_3 }, -{ "4", '4', '$', SDLK_4 }, -{ "5", '5', '%', SDLK_5 }, -{ "6", '6', '^', SDLK_6 }, -{ "7", '7', '&', SDLK_7 }, -{ "8", '8', '*', SDLK_8 }, -{ "9", '9', '(', SDLK_9 }, -{ "0", '0', ')', SDLK_0 }, -{ "-", '-', '_', SDLK_MINUS }, -{ "=", '=', '+', SDLK_EQUALS }, -{ "BSPC", 255, 255, SDLK_BACKSPACE }, -{ "TAB", 255, 255, SDLK_TAB }, -{ "Q", 'q', 'Q', SDLK_q }, -{ "W", 'w', 'W', SDLK_w }, -{ "E", 'e', 'E', SDLK_e }, -{ "R", 'r', 'R', SDLK_r }, -{ "T", 't', 'T', SDLK_t }, -{ "Y", 'y', 'Y', SDLK_y }, -{ "U", 'u', 'U', SDLK_u }, -{ "I", 'i', 'I', SDLK_i }, -{ "O", 'o', 'O', SDLK_o }, -{ "P", 'p', 'P', SDLK_p }, -{ "[", '[', '{', SDLK_LEFTBRACKET }, -{ "]", ']', '}', SDLK_RIGHTBRACKET }, -//edited 06/08/99 Matt Mueller - set to correct key_text -{ "ƒ", 255, 255, SDLK_RETURN }, -//end edit -MM -{ "LCTRL", 255, 255, SDLK_LCTRL }, -{ "A", 'a', 'A', SDLK_a }, -{ "S", 's', 'S', SDLK_s }, -{ "D", 'd', 'D', SDLK_d }, -{ "F", 'f', 'F', SDLK_f }, -{ "G", 'g', 'G', SDLK_g }, -{ "H", 'h', 'H', SDLK_h }, -{ "J", 'j', 'J', SDLK_j }, -{ "K", 'k', 'K', SDLK_k }, -{ "L", 'l', 'L', SDLK_l }, -//edited 06/08/99 Matt Mueller - set to correct sym -{ ";", ';', ':', SDLK_SEMICOLON }, -//end edit -MM -{ "'", '\'', '"', SDLK_QUOTE }, -//edited 06/08/99 Matt Mueller - set to correct sym -{ "`", '`', '~', SDLK_BACKQUOTE }, -//end edit -MM -{ "LSHFT", 255, 255, SDLK_LSHIFT }, -{ "\\", '\\', '|', SDLK_BACKSLASH }, -{ "Z", 'z', 'Z', SDLK_z }, -{ "X", 'x', 'X', SDLK_x }, -{ "C", 'c', 'C', SDLK_c }, -{ "V", 'v', 'V', SDLK_v }, -{ "B", 'b', 'B', SDLK_b }, -{ "N", 'n', 'N', SDLK_n }, -{ "M", 'm', 'M', SDLK_m }, -//edited 06/08/99 Matt Mueller - set to correct syms -{ ",", ',', '<', SDLK_COMMA }, -{ ".", '.', '>', SDLK_PERIOD }, -{ "/", '/', '?', SDLK_SLASH }, -//end edit -MM -{ "RSHFT", 255, 255, SDLK_RSHIFT }, -{ "PAD*", '*', 255, SDLK_KP_MULTIPLY }, -{ "LALT", 255, 255, SDLK_LALT }, -{ "SPC", ' ', ' ', SDLK_SPACE }, -{ "CPSLK", 255, 255, SDLK_CAPSLOCK }, -{ "F1", 255, 255, SDLK_F1 }, -{ "F2", 255, 255, SDLK_F2 }, -{ "F3", 255, 255, SDLK_F3 }, -{ "F4", 255, 255, SDLK_F4 }, -{ "F5", 255, 255, SDLK_F5 }, -{ "F6", 255, 255, SDLK_F6 }, -{ "F7", 255, 255, SDLK_F7 }, -{ "F8", 255, 255, SDLK_F8 }, -{ "F9", 255, 255, SDLK_F9 }, -{ "F10", 255, 255, SDLK_F10 }, -{ "NMLCK", 255, 255, SDLK_NUMLOCK }, -{ "SCLK", 255, 255, SDLK_SCROLLOCK }, -{ "PAD7", 255, 255, SDLK_KP7 }, -{ "PAD8", 255, 255, SDLK_KP8 }, -{ "PAD9", 255, 255, SDLK_KP9 }, -{ "PAD-", 255, 255, SDLK_KP_MINUS }, -{ "PAD4", 255, 255, SDLK_KP4 }, -{ "PAD5", 255, 255, SDLK_KP5 }, -{ "PAD6", 255, 255, SDLK_KP6 }, -{ "PAD+", 255, 255, SDLK_KP_PLUS }, -{ "PAD1", 255, 255, SDLK_KP1 }, -{ "PAD2", 255, 255, SDLK_KP2 }, -{ "PAD3", 255, 255, SDLK_KP3 }, -{ "PAD0", 255, 255, SDLK_KP0 }, -{ "PAD.", 255, 255, SDLK_KP_PERIOD }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "F11", 255, 255, SDLK_F11 }, -{ "F12", 255, 255, SDLK_F12 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -//edited 06/08/99 Matt Mueller - add pause ability -{ "PAUSE", 255, 255, SDLK_PAUSE }, -//end edit -MM -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -//edited 06/08/99 Matt Mueller - set to correct key_text -{ "PADƒ", 255, 255, SDLK_KP_ENTER }, -//end edit -MM -//edited 06/08/99 Matt Mueller - set to correct sym -{ "RCTRL", 255, 255, SDLK_RCTRL }, -//end edit -MM -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "PAD/", 255, 255, SDLK_KP_DIVIDE }, -{ "", 255, 255, -1 }, -//edited 06/08/99 Matt Mueller - add printscreen ability -{ "PRSCR", 255, 255, SDLK_PRINT }, -//end edit -MM -{ "RALT", 255, 255, SDLK_RALT }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "HOME", 255, 255, SDLK_HOME }, -//edited 06/08/99 Matt Mueller - set to correct key_text -{ "UP", 255, 255, SDLK_UP }, -//end edit -MM -{ "PGUP", 255, 255, SDLK_PAGEUP }, -{ "", 255, 255, -1 }, -//edited 06/08/99 Matt Mueller - set to correct key_text -{ "LEFT", 255, 255, SDLK_LEFT }, -//end edit -MM -{ "", 255, 255, -1 }, -//edited 06/08/99 Matt Mueller - set to correct key_text -{ "RIGHT", 255, 255, SDLK_RIGHT }, -//end edit -MM -{ "", 255, 255, -1 }, -//edited 06/08/99 Matt Mueller - set to correct key_text -{ "END", 255, 255, SDLK_END }, -//end edit -MM -{ "DOWN", 255, 255, SDLK_DOWN }, -{ "PGDN", 255, 255, SDLK_PAGEDOWN }, -{ "INS", 255, 255, SDLK_INSERT }, -{ "DEL", 255, 255, SDLK_DELETE }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -{ "", 255, 255, -1 }, -}; - -char *key_text[256]; - -void key_buid_key_text(void) -{ -} - -unsigned char key_to_ascii(int keycode ) -{ - int shifted; - - shifted = keycode & KEY_SHIFTED; - keycode &= 0xFF; - - if (shifted) - return key_properties[keycode].shifted_ascii_value; - else - return key_properties[keycode].ascii_value; -} - -void key_handler(SDL_KeyboardEvent *event) -{ - ubyte state; - int i, keycode, event_key, key_state; - Key_info *key; - unsigned char temp; - - event_key = event->keysym.sym; - - key_state = (event->state == SDL_PRESSED); // !(wInfo & KF_UP); - //===================================================== - //Here a translation from win keycodes to mac keycodes! - //===================================================== - - for (i = 255; i >= 0; i--) { - - keycode = i; - key = &(key_data.keys[keycode]); - if (key_properties[i].sym == event_key) - state = key_state; - else - state = key->last_state; - - if ( key->last_state == state ) { - if (state) { - key->counter++; - keyd_last_pressed = keycode; - keyd_time_when_last_pressed = timer_get_fixed_seconds(); - } - } else { - if (state) { - keyd_last_pressed = keycode; - keyd_pressed[keycode] = 1; - key->downcount += state; - key->state = 1; - key->timewentdown = keyd_time_when_last_pressed = timer_get_fixed_seconds(); - key->counter++; - } else { - keyd_pressed[keycode] = 0; - keyd_last_released = keycode; - key->upcount += key->state; - key->state = 0; - key->counter = 0; - key->timehelddown += timer_get_fixed_seconds() - key->timewentdown; - } - } - if ( (state && !key->last_state) || (state && key->last_state && (key->counter > 30) && (key->counter & 0x01)) ) { - if ( keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) - keycode |= KEY_SHIFTED; - if ( keyd_pressed[KEY_LALT] || keyd_pressed[KEY_RALT]) - keycode |= KEY_ALTED; - if ( keyd_pressed[KEY_LCTRL] || keyd_pressed[KEY_RCTRL]) - keycode |= KEY_CTRLED; - if ( keyd_pressed[KEY_DELETE] ) - keycode |= KEY_DEBUGGED; - temp = key_data.keytail+1; - if ( temp >= KEY_BUFFER_SIZE ) temp=0; - if (temp!=key_data.keyhead) { - key_data.keybuffer[key_data.keytail] = keycode; - key_data.time_pressed[key_data.keytail] = keyd_time_when_last_pressed; - key_data.keytail = temp; - } - } - key->last_state = state; - } -} - -void key_close() -{ - Installed = 0; -} - -void key_init() -{ - int i; - - if (Installed) return; - - Installed=1; - - keyd_time_when_last_pressed = timer_get_fixed_seconds(); - keyd_buffer_type = 1; - keyd_repeat = 1; - - for(i=0; i<256; i++) - key_text[i] = key_properties[i].key_text; - - // Clear the keyboard array - key_flush(); - atexit(key_close); -} - -void key_flush() -{ - int i; - fix curtime; - - if (!Installed) - key_init(); - - key_data.keyhead = key_data.keytail = 0; - - //Clear the keyboard buffer - for (i=0; i= KEY_BUFFER_SIZE ) n=0; - return n; -} - -int key_checkch() -{ - int is_one_waiting = 0; - event_poll(); - if (key_data.keytail!=key_data.keyhead) - is_one_waiting = 1; - return is_one_waiting; -} - -int key_inkey() -{ - int key = 0; - if (!Installed) - key_init(); - event_poll(); - if (key_data.keytail!=key_data.keyhead) { - key = key_data.keybuffer[key_data.keyhead]; - key_data.keyhead = add_one(key_data.keyhead); - } -//added 9/3/98 by Matt Mueller to free cpu time instead of hogging during menus and such - else d_delay(1); -//end addition - Matt Mueller - - return key; -} - -int key_inkey_time(fix * time) -{ - int key = 0; - - if (!Installed) - key_init(); - event_poll(); - if (key_data.keytail!=key_data.keyhead) { - key = key_data.keybuffer[key_data.keyhead]; - *time = key_data.time_pressed[key_data.keyhead]; - key_data.keyhead = add_one(key_data.keyhead); - } - return key; -} - -int key_peekkey() -{ - int key = 0; - event_poll(); - if (key_data.keytail!=key_data.keyhead) - key = key_data.keybuffer[key_data.keyhead]; - - return key; -} - -int key_getch() -{ - int dummy=0; - - if (!Installed) - return 0; -// return getch(); - - while (!key_checkch()) - dummy++; - return key_inkey(); -} - -unsigned int key_get_shift_status() -{ - unsigned int shift_status = 0; - - if ( keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT] ) - shift_status |= KEY_SHIFTED; - - if ( keyd_pressed[KEY_LALT] || keyd_pressed[KEY_RALT] ) - shift_status |= KEY_ALTED; - - if ( keyd_pressed[KEY_LCTRL] || keyd_pressed[KEY_RCTRL] ) - shift_status |= KEY_CTRLED; - -#ifndef NDEBUG - if (keyd_pressed[KEY_DELETE]) - shift_status |=KEY_DEBUGGED; -#endif - - return shift_status; -} - -// Returns the number of seconds this key has been down since last call. -fix key_down_time(int scancode) -{ - fix time_down, time; - - event_poll(); - if ((scancode<0)|| (scancode>255)) return 0; - - if (!keyd_pressed[scancode]) { - time_down = key_data.keys[scancode].timehelddown; - key_data.keys[scancode].timehelddown = 0; - } else { - time = timer_get_fixed_seconds(); - time_down = time - key_data.keys[scancode].timewentdown; - key_data.keys[scancode].timewentdown = time; - } - - return time_down; -} - -unsigned int key_down_count(int scancode) -{ - int n; - event_poll(); - if ((scancode<0)|| (scancode>255)) return 0; - - n = key_data.keys[scancode].downcount; - key_data.keys[scancode].downcount = 0; - - return n; -} - -unsigned int key_up_count(int scancode) -{ - int n; - event_poll(); - if ((scancode<0)|| (scancode>255)) return 0; - - n = key_data.keys[scancode].upcount; - key_data.keys[scancode].upcount = 0; - - return n; -} diff --git a/input/sdl/mouse.c b/input/sdl/mouse.c deleted file mode 100644 index c0f01830..00000000 --- a/input/sdl/mouse.c +++ /dev/null @@ -1,234 +0,0 @@ -// SDL mouse driver. - -#include -#include -#include -#include "fix.h" -#include "timer.h" -#include "event.h" -#include "mouse.h" - -struct mousebutton { - ubyte pressed; - fix time_went_down; - fix time_held_down; - uint num_downs; - uint num_ups; -}; - -static struct mouseinfo { - struct mousebutton buttons[MOUSE_MAX_BUTTONS]; -//added on 10/17/98 by Hans de Goede for mouse functionality - int min_x, min_y; - int max_x, max_y; - int delta_x, delta_y; - int x,y; -//end this section addition - Hans -} Mouse; - -//added on 10/17/98 by Hans de Goede for mouse functionality -void d_mouse_init(void) -{ - memset(&Mouse,0,sizeof(Mouse)); -} - -//added/changed on 10/17/98 by Hans de Goede for mouse functionality -//void mouse_handler(SDL_MouseButtonEvent *mbe) -void mouse_button_handler(SDL_MouseButtonEvent *mbe) -{ - // to bad, SDL buttons use a different mapping as descent expects, - // this is atleast true and tested for the first three buttons - int button_remap[11] = { - MB_LEFT, - MB_MIDDLE, - MB_RIGHT, - MB_Z_UP, - MB_Z_DOWN, - MB_PITCH_BACKWARD, - MB_PITCH_FORWARD, - MB_BANK_LEFT, - MB_BANK_RIGHT, - MB_HEAD_LEFT, - MB_HEAD_RIGHT }; - - int button = button_remap[mbe->button - 1]; // -1 since SDL seems to start counting at 1 - - if (mbe->state == SDL_PRESSED) { -// Mouse.buttons[mbe->button].pressed = 1; -// Mouse.buttons[mbe->button].time_went_down = timer_get_fixed_seconds(); -// Mouse.buttons[mbe->button].num_downs++; - Mouse.buttons[button].pressed = 1; - Mouse.buttons[button].time_went_down = timer_get_fixed_seconds(); - Mouse.buttons[button].num_downs++; - } else { -// Mouse.buttons[mbe->button].pressed = 0; -// Mouse.buttons[mbe->button].time_held_down += timer_get_fixed_seconds() - Mouse.buttons[mbe->button].time_went_down; -// Mouse.buttons[mbe->button].num_ups++; - Mouse.buttons[button].pressed = 0; - Mouse.buttons[button].time_held_down += timer_get_fixed_seconds() - Mouse.buttons[mbe->button].time_went_down; - Mouse.buttons[button].num_ups++; -//end this section addition/change - Hans - } -} - -//added on 10/17/98 by Hans de Goede for mouse functionality -void mouse_motion_handler(SDL_MouseMotionEvent *mme) -{ - Mouse.delta_x += mme->xrel; - Mouse.delta_y += mme->yrel; - Mouse.x += mme->xrel; - Mouse.y += mme->yrel; - if (Mouse.x > Mouse.max_x) Mouse.x = Mouse.max_x; - else if (Mouse.x < Mouse.min_x) Mouse.x = Mouse.min_x; - if (Mouse.y > Mouse.max_y) Mouse.y = Mouse.max_y; - else if (Mouse.y < Mouse.min_y) Mouse.y = Mouse.min_y; -} -//end this section addition - Hans - - -int mouse_set_limits( int x1, int y1, int x2, int y2 ) -{ -//added on 10/17/98 by Hans de Goede for mouse functionality -//-killed- // Shrug... -//-killed- event_poll(); - Mouse.min_x = x1; - Mouse.min_y = y1; - Mouse.max_x = x2; - Mouse.max_y = y2; -//end this section addition - Hans - return 0; -} - -void mouse_flush() // clears all mice events... -{ - int i; - fix current_time; - - event_poll(); - - current_time = timer_get_fixed_seconds(); - for (i=0; i Mouse.max_x) Mouse.x = Mouse.max_x; - else if (Mouse.x < Mouse.min_x) Mouse.x = Mouse.min_x; - if (Mouse.y > Mouse.max_y) Mouse.y = Mouse.max_y; - else if (Mouse.y < Mouse.min_y) Mouse.y = Mouse.min_y; -//end this section change - Hans -} - -void mouse_get_cyberman_pos( int *x, int *y ) -{ - // Shrug... - event_poll(); -} - -// Returns how long this button has been down since last call. -fix mouse_button_down_time(int button) -{ - fix time_down, time; - - event_poll(); - - if (!Mouse.buttons[button].pressed) { - time_down = Mouse.buttons[button].time_held_down; - Mouse.buttons[button].time_held_down = 0; - } else { - time = timer_get_fixed_seconds(); - time_down = time - Mouse.buttons[button].time_held_down; - Mouse.buttons[button].time_held_down = time; - } - return time_down; -} - -// Returns how many times this button has went down since last call -int mouse_button_down_count(int button) -{ - int count; - - event_poll(); - - count = Mouse.buttons[button].num_downs; - Mouse.buttons[button].num_downs = 0; - - return count; -} - -// Returns 1 if this button is currently down -int mouse_button_state(int button) -{ - event_poll(); - return Mouse.buttons[button].pressed; -} - - diff --git a/input/sdl_event.c b/input/sdl_event.c index 85caad2a..1731bc81 100644 --- a/input/sdl_event.c +++ b/input/sdl_event.c @@ -1,8 +1,18 @@ -// SDL Event related stuff +/* + * $Source: /cvs/cvsroot/d2x/input/sdl_event.c,v $ + * $Revision: 1.2 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 14:03:57 $ + * + * SDL Event related stuff + * + * $Log: not supported by cvs2svn $ + */ +#ifdef HAVE_CONFIG_H #include +#endif -#ifdef SDL_INPUT #include #include @@ -54,5 +64,3 @@ int event_init() return 0; } - -#endif diff --git a/input/sdl_joy.c b/input/sdl_joy.c new file mode 100644 index 00000000..076ac43e --- /dev/null +++ b/input/sdl_joy.c @@ -0,0 +1,109 @@ +/* + * $Source: /cvs/cvsroot/d2x/input/sdl_joy.c,v $ + * $Revision: 1.1 $ + * $Author: bradleyb $ + * $Date: 2001-10-10 03:01:29 $ + * + * SDL joystick support + * + * $Log: not supported by cvs2svn $ + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "joy.h" +#include "error.h" + +char joy_present = 0; + +int +joy_init() +{ + if (SDL_Init( SDL_INIT_JOYSTICK ) < 0) + { + Warning("SDL library initialisation failed: %s.", SDL_GetError()); + return 0; + } + + + + return 1; +} + +void +joy_close() +{ + return; +} + +void +joy_get_pos(int *x, int *y) +{ + *x = *y = 0; + return; +} + +int +joy_get_btns() +{ + return 0; +} + +int +joy_get_button_down_cnt(int btn) +{ + return 0; +} + +fix +joy_get_button_down_time(int btn) +{ + return 0; +} + +ubyte +joystick_read_raw_axis(ubyte mask, int *axis) +{ + return 0; +} + +void +joy_flush() +{ + return; +} + +int +joy_get_button_state(int btn) +{ + return 0; +} + +void +joy_get_cal_vals(int *axis_min, int *axis_center, int *axis_max) +{ + return; +} + +void +joy_set_cal_vals(int *axis_min, int *axis_center, int *axis_max) +{ + return; +} + +int +joy_get_scaled_reading(int raw, int axn) +{ + return 0; +} + +void +joy_set_slow_reading(int flag) +{ + return; +} diff --git a/input/sdl_joydefs.c b/input/sdl_joydefs.c new file mode 100644 index 00000000..5f48a00e --- /dev/null +++ b/input/sdl_joydefs.c @@ -0,0 +1,31 @@ +/* + * $Source: /cvs/cvsroot/d2x/input/sdl_joydefs.c,v $ + * $Revision: 1.1 $ + * $Author: bradleyb $ + * $Date: 2001-10-10 03:01:29 $ + * + * SDL joystick support + * + * $Log: not supported by cvs2svn $ + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "joydefs.h" + +int joydefs_calibrate_flag = 0; + +void +joydefs_calibrate() +{ + return; +} + +void +joydefs_config() +{ + return; +} diff --git a/input/sdl_key.c b/input/sdl_key.c index a158a5f2..1dae0539 100644 --- a/input/sdl_key.c +++ b/input/sdl_key.c @@ -1,8 +1,17 @@ -// SDL keyboard input support - +/* + * $Source: /cvs/cvsroot/d2x/input/sdl_key.c,v $ + * $Revision: 1.2 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 14:03:57 $ + * + * SDL keyboard input support + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include - -#ifdef SDL_INPUT +#endif #include #include @@ -617,5 +626,3 @@ unsigned int key_up_count(int scancode) return n; } - -#endif //SDL_INPUT diff --git a/input/sdl_mouse.c b/input/sdl_mouse.c index 06c5e24b..b35746bd 100644 --- a/input/sdl_mouse.c +++ b/input/sdl_mouse.c @@ -1,8 +1,18 @@ -// SDL mouse driver. - +/* + * $Source: /cvs/cvsroot/d2x/input/sdl_mouse.c,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 14:03:57 $ + * + * SDL mouse driver. + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include +#endif -#ifdef SDL_INPUT #include #include #include "fix.h" @@ -10,6 +20,8 @@ #include "event.h" #include "mouse.h" +#define MOUSE_MAX_BUTTONS 8 + struct mousebutton { ubyte pressed; fix time_went_down; @@ -87,8 +99,8 @@ void mouse_motion_handler(SDL_MouseMotionEvent *mme) } //end this section addition - Hans - -int mouse_set_limits( int x1, int y1, int x2, int y2 ) +void +mouse_set_limits( int x1, int y1, int x2, int y2 ) { //added on 10/17/98 by Hans de Goede for mouse functionality //-killed- // Shrug... @@ -98,7 +110,6 @@ int mouse_set_limits( int x1, int y1, int x2, int y2 ) Mouse.max_x = x2; Mouse.max_y = y2; //end this section addition - Hans - return 0; } void mouse_flush() // clears all mice events... @@ -232,7 +243,3 @@ int mouse_button_state(int button) event_poll(); return Mouse.buttons[button].pressed; } - - - -#endif // SDL_INPUT diff --git a/arch/linux/svgalib/event.c b/input/svgalib_event.c similarity index 64% rename from arch/linux/svgalib/event.c rename to input/svgalib_event.c index 21fa607b..787c0786 100644 --- a/arch/linux/svgalib/event.c +++ b/input/svgalib_event.c @@ -1,4 +1,17 @@ -// SDL Event related stuff +/* + * $Source: /cvs/cvsroot/d2x/input/svgalib_event.c,v $ + * $Revision: 1.2 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 14:03:57 $ + * + * SVGALib Event related stuff + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif #include #include diff --git a/input/svgalib_init.c b/input/svgalib_init.c new file mode 100644 index 00000000..edc22ee1 --- /dev/null +++ b/input/svgalib_init.c @@ -0,0 +1,24 @@ +/* + * $Source: /cvs/cvsroot/d2x/input/svgalib_init.c,v $ + * $Revision: 1.4 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 14:03:57 $ + * + * SVGALib initialization + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "args.h" + +extern void d_mouse_init(); + +void arch_svgalib_init() +{ + if (!FindArg("-nomouse")) + d_mouse_init(); +} diff --git a/arch/linux/svgalib/key.c b/input/svgalib_key.c similarity index 89% rename from arch/linux/svgalib/key.c rename to input/svgalib_key.c index 191eb3be..c3495e18 100644 --- a/arch/linux/svgalib/key.c +++ b/input/svgalib_key.c @@ -1,4 +1,17 @@ -/// SDL keyboard input support +/* + * $Source: /cvs/cvsroot/d2x/input/svgalib_key.c,v $ + * $Revision: 1.2 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 14:03:57 $ + * + * SVGALib keyboard input support + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif #include #include @@ -46,27 +59,7 @@ typedef struct keyboard { static /*volatile*/ keyboard key_data; -char * key_text[256] = { -"","ESC","1","2","3","4","5","6","7","8","9","0","-", -"=","BSPC","TAB","Q","W","E","R","T","Y","U","I","O", -"P","[","]","ƒ","LCTRL","A","S","D","F", -"G","H","J","K","L",";","'","`", -"LSHFT","\\","Z","X","C","V","B","N","M",",", -".","/","RSHFT","PAD*","LALT","SPC", -"CPSLK","F1","F2","F3","F4","F5","F6","F7","F8","F9", -"F10","NMLCK","SCLK","PAD7","PAD8","PAD9","PAD-", -"PAD4","PAD5","PAD6","PAD+","PAD1","PAD2","PAD3","PAD0", -"PAD.","","","","F11","F12","","","","","","","","","", -"","","","","","","","","","","","","","","","","","","","", -"","","","","","","","","","","","","","","","","","","","", -"","","","","","","","","","","","","","","","","","", -"PADƒ","RCTRL","","","","","","","","","","","","","", -"","","","","","","","","","","PAD/","","","RALT","", -"","","","","","","","","","","","","","HOME","‚","PGUP", -"","","","","","END","€","PGDN","INS", -"DEL","","","","","","","","","","","","","","","","","", -"","","","","","","","","","","","","","","","","","","","", -"","","","","","","" }; +char *key_text[256]; unsigned char ascii_table[128] = { 255, 255, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=',255,255, @@ -380,4 +373,3 @@ unsigned int key_up_count(int scancode) return n; } - diff --git a/arch/linux/svgalib/mouse.c b/input/svgalib_mouse.c similarity index 75% rename from arch/linux/svgalib/mouse.c rename to input/svgalib_mouse.c index 4e528c67..99df3c56 100644 --- a/arch/linux/svgalib/mouse.c +++ b/input/svgalib_mouse.c @@ -1,3 +1,21 @@ +/* + * $Source: /cvs/cvsroot/d2x/input/svgalib_mouse.c,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 14:03:57 $ + * + * SVGALib mouse support + * + * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/01/28 16:09:39 bradleyb + * Removed duplicate files, and unified input headers. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -6,6 +24,8 @@ #include "event.h" #include "mouse.h" +#define MOUSE_MAX_BUTTONS 8 + ubyte installed = 0; struct mousebutton { @@ -26,24 +46,32 @@ static struct mouseinfo { //end this section addition - Hans } Mouse; -void mouse_handler (int button, int dx, int dy, int dz, int drx, int dry, int drz) +void mouse_handler (int vga_button, int dx, int dy, int dz, int drx, int dry, int drz) { int i; + int button; + int state; + + /* map bit 0,1,2 (R,M,L) to 1,2,0 */ + button = ((vga_button & 1) << 1) | ((vga_button & 2) << 1) | + ((vga_button & 4) >> 2); + for (i = 0; i < 8; i++) { - if (button & (1 << i)) - { - Mouse.buttons[i].pressed = 1; - Mouse.buttons[i].time_went_down = timer_get_fixed_seconds(); - Mouse.buttons[i].num_downs++; - } - else - { - Mouse.buttons[i].pressed = 0; - Mouse.buttons[i].time_held_down += timer_get_fixed_seconds() - Mouse.buttons[i].time_went_down; - Mouse.buttons[i].num_ups++; - } + state = button & (1 << i); + if (!Mouse.buttons[i].pressed && state) + { + Mouse.buttons[i].time_went_down = timer_get_fixed_seconds(); + Mouse.buttons[i].num_downs++; + } + else if (Mouse.buttons[i].pressed && !state) + { + Mouse.buttons[i].num_ups++; + } + + Mouse.buttons[i].pressed = state; } + Mouse.delta_x += dx; Mouse.delta_y += dy; Mouse.x += dx; @@ -61,23 +89,25 @@ void d_mouse_close(void) installed = 0; } -void d_mouse_init(void) +int +d_mouse_init(int enable_cyberman) { memset(&Mouse,0,sizeof(Mouse)); vga_setmousesupport(1); if (!installed) atexit(d_mouse_close); installed = 1; + return 0; /* should return # of buttons... dunno how w/svgalib */ } -int mouse_set_limits( int x1, int y1, int x2, int y2 ) +void +mouse_set_limits( int x1, int y1, int x2, int y2 ) { event_poll(); Mouse.min_x = x1; Mouse.min_y = y1; Mouse.max_x = x2; Mouse.max_y = y2; - return 0; } void mouse_flush() // clears all mice events... @@ -193,5 +223,3 @@ int mouse_button_state(int button) event_poll(); return Mouse.buttons[button].pressed; } - - diff --git a/libtool b/libtool deleted file mode 100644 index c8782d26..00000000 --- a/libtool +++ /dev/null @@ -1,4240 +0,0 @@ -#! /bin/sh - -# libtool - Provide generalized library-building support services. -# Generated automatically by ltconfig (GNU libtool 1.3.3 (1.385.2.181 1999/07/02 15:49:11)) -# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. -# -# Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="sed -e s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi - -### BEGIN LIBTOOL CONFIG -# Libtool was configured as follows, on host nexus: -# -# CC="gcc" CFLAGS="-g -O2" CPPFLAGS="" \ -# LD="/usr/bin/ld" LDFLAGS="" LIBS="" \ -# NM="/usr/bin/nm -B" RANLIB="ranlib" LN_S="ln -s" \ -# DLLTOOL="" OBJDUMP="" AS="" \ -# ./ltconfig --cache-file=./config.cache --with-gcc --with-gnu-ld --no-verify ./ltmain.sh i686-pc-linux-gnu -# -# Compiler and other test output produced by ltconfig, useful for -# debugging ltconfig, is in ./config.log if it exists. - -# The version of ltconfig that generated this script. -LTCONFIG_VERSION="1.3.3" - -# Shell to use when invoking shell scripts. -SHELL="/bin/sh" - -# Whether or not to build shared libraries. -build_libtool_libs=yes - -# Whether or not to build static libraries. -build_old_libs=yes - -# Whether or not to optimize for fast installation. -fast_install=yes - -# The host system. -host_alias=i686-pc-linux-gnu -host=i686-pc-linux-gnu - -# An echo program that does not interpret backslashes. -echo="echo" - -# The archiver. -AR="ar" - -# The default C compiler. -CC="gcc" - -# The linker used to build libraries. -LD="/usr/bin/ld" - -# Whether we need hard or soft links. -LN_S="ln -s" - -# A BSD-compatible nm program. -NM="/usr/bin/nm -B" - -# Used on cygwin: DLL creation program. -DLLTOOL="dlltool" - -# Used on cygwin: object dumper. -OBJDUMP="objdump" - -# Used on cygwin: assembler. -AS="as" - -# The name of the directory that contains temporary libtool files. -objdir=.libs - -# How to create reloadable object files. -reload_flag=" -r" -reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs" - -# How to pass a linker flag through the compiler. -wl="-Wl," - -# Object file suffix (normally "o"). -objext="o" - -# Old archive suffix (normally "a"). -libext="a" - -# Executable file suffix (normally ""). -exeext="" - -# Additional compiler flags for building library objects. -pic_flag=" -fPIC" - -# Does compiler simultaneously support -c and -o options? -compiler_c_o="yes" - -# Can we write directly to a .lo ? -compiler_o_lo="yes" - -# Must we lock files when doing compilation ? -need_locks="no" - -# Do we need the lib prefix for modules? -need_lib_prefix=no - -# Do we need a version for libraries? -need_version=no - -# Whether dlopen is supported. -dlopen=unknown - -# Whether dlopen of programs is supported. -dlopen_self=unknown - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=unknown - -# Compiler flag to prevent dynamic linking. -link_static_flag="-static" - -# Compiler flag to turn off builtin functions. -no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions" - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec="\${wl}--export-dynamic" - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec="" - -# Library versioning type. -version_type=linux - -# Format of library name prefix. -libname_spec="lib\$name" - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so" - -# The coded name of the library, if different from the real name. -soname_spec="\${libname}\${release}.so\$major" - -# Commands used to build and install an old-style archive. -RANLIB="ranlib" -old_archive_cmds="\$AR cru \$oldlib\$oldobjs~\$RANLIB \$oldlib" -old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib" -old_postuninstall_cmds="" - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds="" - -# Commands used to build and install a shared archive. -archive_cmds="\$CC -shared \$libobjs \$deplibs \$linkopts \${wl}-soname \$wl\$soname -o \$lib" -archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$linkopts \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib" -postinstall_cmds="" -postuninstall_cmds="" - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )" - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd="/usr/bin/file" - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag="" - -# Flag that forces no undefined symbols. -no_undefined_flag="" - -# Commands used to finish a libtool library installation in a directory. -finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir" - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval="" - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW]\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'" - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'" - -# This is the shared library runtime path variable. -runpath_var=LD_RUN_PATH - -# This is the shared library path variable. -shlibpath_var=LD_LIBRARY_PATH - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=no - -# How to hardcode a shared library path into an executable. -hardcode_action=immediate - -# Flag to hardcode $libdir into a binary during linking. -# This must work even if $libdir does not exist. -hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir" -if test -f /etc/debian_version; then -# Debian policy mandates that rpaths should not be encoded into a binary -# so it is overridden. - hardcode_libdir_flag_spec=" -D_DEBIAN_PATCHED_LIBTOOL_ " -fi - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator="" - -# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=no - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=no - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=unsupported - -# Compile-time system search path for libraries -sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec="/lib /usr/lib" - -# Fix the shell variable $srcfile for the compiler. -fix_srcfile_path="" - -# Set to yes if exported symbols are required. -always_export_symbols=no - -# The commands to list exported symbols. -export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols" - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms="_GLOBAL_OFFSET_TABLE_" - -# Symbols that must always be exported. -include_expsyms="" - -### END LIBTOOL CONFIG - -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun ltconfig. -# -# Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Check that we have a working $echo. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 -fi - -if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - echo "$modename: not configured to build any kind of library" 1>&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 -fi - -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" - -# Parse our command line options once, thoroughly. -while test $# -gt 0 -do - arg="$1" - shift - - case "$arg" in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case "$prev" in - execute_dlfiles) - eval "$prev=\"\$$prev \$arg\"" - ;; - *) - eval "$prev=\$arg" - ;; - esac - - prev= - prevopt= - continue - fi - - # Have we seen a non-optional argument yet? - case "$arg" in - --help) - show_help=yes - ;; - - --version) - echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - exit 0 - ;; - - --config) - sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0 - exit 0 - ;; - - --debug) - echo "$progname: enabling shell trace mode" - set -x - ;; - - --dry-run | -n) - run=: - ;; - - --features) - echo "host: $host" - if test "$build_libtool_libs" = yes; then - echo "enable shared libraries" - else - echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - echo "enable static libraries" - else - echo "disable static libraries" - fi - exit 0 - ;; - - --finish) mode="finish" ;; - - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - - --quiet | --silent) - show=: - ;; - - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles - ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - - *) - nonopt="$arg" - break - ;; - esac -done - -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 -fi - -if test -z "$show_help"; then - - # Infer the operation mode. - if test -z "$mode"; then - case "$nonopt" in - *cc | *++ | gcc* | *-gcc*) - mode=link - for arg - do - case "$arg" in - -c) - mode=compile - break - ;; - esac - done - ;; - *db | *dbx | *strace | *truss) - mode=execute - ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute - - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi - fi - ;; - esac - fi - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." - - # These modes are in order of execution frequency so that they run quickly. - case "$mode" in - # libtool compile mode - compile) - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= - lastarg= - srcfile="$nonopt" - suppress_output= - - user_target=no - for arg - do - # Accept any command-line options. - case "$arg" in - -o) - if test "$user_target" != "no"; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit 1 - fi - user_target=next - ;; - - -static) - build_old_libs=yes - continue - ;; - esac - - case "$user_target" in - next) - # The next one is the -o target name - user_target=yes - continue - ;; - yes) - # We got the output file - user_target=set - libobj="$arg" - continue - ;; - esac - - # Accept the current argument as the source file. - lastarg="$srcfile" - srcfile="$arg" - - # Aesthetically quote the previous argument. - - # Backslashify any backslashes, double quotes, and dollar signs. - # These are the only characters that are still specially - # interpreted inside of double-quoted scrings. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly in scan - # sets, so we specify it separately. - case "$lastarg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - lastarg="\"$lastarg\"" - ;; - esac - - # Add the previous argument to base_compile. - if test -z "$base_compile"; then - base_compile="$lastarg" - else - base_compile="$base_compile $lastarg" - fi - done - - case "$user_target" in - set) - ;; - no) - # Get the name of the library object. - libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; - *) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit 1 - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - xform='[cCFSfmso]' - case "$libobj" in - *.ada) xform=ada ;; - *.adb) xform=adb ;; - *.ads) xform=ads ;; - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; - *.for) xform=for ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - - case "$libobj" in - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - exit 1 - ;; - esac - - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $libobj" - else - removelist="$libobj" - fi - - $run $rm $removelist - trap "$run $rm $removelist; exit 1" 1 2 15 - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext} - lockfile="$output_obj.lock" - removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit 1" 1 2 15 - else - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until ln "$0" "$lockfile" 2>/dev/null; do - $show "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - echo "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - echo $srcfile > "$lockfile" - fi - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - # All platforms use -DPIC, to notify preprocessed assembler code. - command="$base_compile $pic_flag -DPIC $srcfile" - if test "$build_old_libs" = yes; then - lo_libobj="$libobj" - dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$libobj"; then - dir="$objdir" - else - dir="$dir/$objdir" - fi - libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` - - if test -d "$dir"; then - $show "$rm $libobj" - $run $rm $libobj - else - $show "$mkdir $dir" - $run $mkdir $dir - status=$? - if test $status -ne 0 && test ! -d $dir; then - exit $status - fi - fi - fi - if test "$compiler_o_lo" = yes; then - output_obj="$libobj" - command="$command -o $output_obj" - elif test "$compiler_c_o" = yes; then - output_obj="$obj" - command="$command -o $output_obj" - fi - - $run $rm "$output_obj" - $show "$command" - if $run eval "$command"; then : - else - test -n "$output_obj" && $run $rm $removelist - exit 1 - fi - - if test "$need_locks" = warn && - test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then - echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - - # Just move the object if needed, then go on to compile the next one - if test x"$output_obj" != x"$libobj"; then - $show "$mv $output_obj $libobj" - if $run $mv $output_obj $libobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # If we have no pic_flag, then copy the object into place and finish. - if test -z "$pic_flag" && test "$build_old_libs" = yes; then - # Rename the .lo from within objdir to obj - if test -f $obj; then - $show $rm $obj - $run $rm $obj - fi - - $show "$mv $libobj $obj" - if $run $mv $libobj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - - # Now arrange that obj and lo_libobj become the same file - $show "$LN_S $obj $lo_libobj" - if $run $LN_S $obj $lo_libobj; then - exit 0 - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Allow error messages only from the first compilation. - suppress_output=' >/dev/null 2>&1' - fi - - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - command="$base_compile $srcfile" - if test "$compiler_c_o" = yes; then - command="$command -o $obj" - output_obj="$obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" - $run $rm "$output_obj" - $show "$command" - if $run eval "$command"; then : - else - $run $rm $removelist - exit 1 - fi - - if test "$need_locks" = warn && - test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then - echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - - # Just move the object if needed - if test x"$output_obj" != x"$obj"; then - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Create an invalid libtool object if no PIC, so that we do not - # accidentally link it into a program. - if test "$build_libtool_libs" != yes; then - $show "echo timestamp > $libobj" - $run eval "echo timestamp > \$libobj" || exit $? - else - # Move the .lo from within objdir - $show "$mv $libobj $lo_libobj" - if $run $mv $libobj $lo_libobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - fi - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - $rm "$lockfile" - fi - - exit 0 - ;; - - # libtool link mode - link) - modename="$modename: link" - C_compiler="$CC" # save it, to compile generated C sources - CC="$nonopt" - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invokation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - - # This is a source program that is used to create dlls on Windows - # Don't remove nor modify the starting and closing comments -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ - # This is a source program that is used to create import libraries - # on Windows for dlls which lack them. Don't remove nor modify the - # starting and closing comments -# /* impgen.c starts here */ -# /* Copyright (C) 1999 Free Software Foundation, Inc. -# -# This file is part of GNU libtool. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# */ -# -# #include /* for printf() */ -# #include /* for open(), lseek(), read() */ -# #include /* for O_RDONLY, O_BINARY */ -# #include /* for strdup() */ -# -# static unsigned int -# pe_get16 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[2]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 2); -# return b[0] + (b[1]<<8); -# } -# -# static unsigned int -# pe_get32 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[4]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 4); -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# static unsigned int -# pe_as32 (ptr) -# void *ptr; -# { -# unsigned char *b = ptr; -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# int -# main (argc, argv) -# int argc; -# char *argv[]; -# { -# int dll; -# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; -# unsigned long export_rva, export_size, nsections, secptr, expptr; -# unsigned long name_rvas, nexp; -# unsigned char *expdata, *erva; -# char *filename, *dll_name; -# -# filename = argv[1]; -# -# dll = open(filename, O_RDONLY|O_BINARY); -# if (!dll) -# return 1; -# -# dll_name = filename; -# -# for (i=0; filename[i]; i++) -# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') -# dll_name = filename + i +1; -# -# pe_header_offset = pe_get32 (dll, 0x3c); -# opthdr_ofs = pe_header_offset + 4 + 20; -# num_entries = pe_get32 (dll, opthdr_ofs + 92); -# -# if (num_entries < 1) /* no exports */ -# return 1; -# -# export_rva = pe_get32 (dll, opthdr_ofs + 96); -# export_size = pe_get32 (dll, opthdr_ofs + 100); -# nsections = pe_get16 (dll, pe_header_offset + 4 +2); -# secptr = (pe_header_offset + 4 + 20 + -# pe_get16 (dll, pe_header_offset + 4 + 16)); -# -# expptr = 0; -# for (i = 0; i < nsections; i++) -# { -# char sname[8]; -# unsigned long secptr1 = secptr + 40 * i; -# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); -# unsigned long vsize = pe_get32 (dll, secptr1 + 16); -# unsigned long fptr = pe_get32 (dll, secptr1 + 20); -# lseek(dll, secptr1, SEEK_SET); -# read(dll, sname, 8); -# if (vaddr <= export_rva && vaddr+vsize > export_rva) -# { -# expptr = fptr + (export_rva - vaddr); -# if (export_rva + export_size > vaddr + vsize) -# export_size = vsize - (export_rva - vaddr); -# break; -# } -# } -# -# expdata = (unsigned char*)malloc(export_size); -# lseek (dll, expptr, SEEK_SET); -# read (dll, expdata, export_size); -# erva = expdata - export_rva; -# -# nexp = pe_as32 (expdata+24); -# name_rvas = pe_as32 (expdata+32); -# -# printf ("EXPORTS\n"); -# for (i = 0; i&2 - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - else - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - fi - build_libtool_libs=no - build_old_libs=yes - prefer_static_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test $# -gt 0; do - arg="$1" - shift - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case "$prev" in - output) - compile_command="$compile_command @OUTPUT@" - finalize_command="$finalize_command @OUTPUT@" - ;; - esac - - case "$prev" in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command="$compile_command @SYMFILE@" - finalize_command="$finalize_command @SYMFILE@" - preload=yes - fi - case "$arg" in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - ;; - esac - ;; - expsyms) - export_symbols="$arg" - if test ! -f "$arg"; then - $echo "$modename: symbol file \`$arg' does not exist" - exit 1 - fi - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case "$arg" in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit 1 - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi - - prevarg="$arg" - - case "$arg" in - -all-static) - if test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 - continue - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: not more than one -exported-symbols argument allowed" - exit 1 - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -L*) - dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` - # We need an absolute path. - case "$dir" in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - absdir="$dir" - fi - dir="$absdir" - ;; - esac - case " $deplibs " in - *" $arg "*) ;; - *) deplibs="$deplibs $arg";; - esac - case " $lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir";; - esac - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2*) - dllsearchdir=`cd "$dir" && pwd || echo "$dir"` - case ":$dllsearchpath:" in - ::) dllsearchpath="$dllsearchdir";; - *":$dllsearchdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dllsearchdir";; - esac - ;; - esac - ;; - - -l*) - if test "$arg" = "-lc"; then - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) - # These systems don't actually have c library (as such) - continue - ;; - esac - elif test "$arg" = "-lm"; then - case "$host" in - *-*-cygwin* | *-*-beos*) - # These systems don't actually have math library (as such) - continue - ;; - esac - fi - deplibs="$deplibs $arg" - ;; - - -module) - module=yes - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -o) prev=output ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` - # We need an absolute path. - case "$dir" in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit 1 - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -static) - # If we have no pic_flag, then this is the same as -all-static. - if test -z "$pic_flag" && test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - - # Some other compiler flag. - -* | +*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - ;; - - *.o | *.obj | *.a | *.lib) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A library object. - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` - prev= - fi - libobjs="$libobjs $arg" - ;; - - *.la) - # A libtool-controlled library. - - dlname= - libdir= - library_names= - old_library= - - # Check to see that this really is a libtool archive. - if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2 - exit 1 - fi - - # If the library was installed with an old release of libtool, - # it will not redefine variable installed. - installed=yes - - # Read the .la file - # If there is no directory component, then add one. - case "$arg" in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$arg'" 1>&2 - exit 1 - fi - - # Find the relevant object directory and library name. - name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'` - - if test "X$installed" = Xyes; then - dir="$libdir" - else - dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$arg"; then - dir="$objdir" - else - dir="$dir/$objdir" - fi - fi - - if test -n "$dependency_libs"; then - # Extract -R and -L from dependency_libs - temp_deplibs= - for deplib in $dependency_libs; do - case "$deplib" in - -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - case " $rpath $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - -L*) case "$compile_command $temp_deplibs " in - *" $deplib "*) ;; - *) temp_deplibs="$temp_deplibs $deplib";; - esac - temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'` - case " $lib_search_path " in - *" $temp_dir "*) ;; - *) lib_search_path="$lib_search_path $temp_dir";; - esac - ;; - *) temp_deplibs="$temp_deplibs $deplib";; - esac - done - dependency_libs="$temp_deplibs" - fi - - if test -z "$libdir"; then - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $dir/$old_library" - old_convenience="$old_convenience $dir/$old_library" - deplibs="$deplibs$dependency_libs" - compile_command="$compile_command $dir/$old_library$dependency_libs" - finalize_command="$finalize_command $dir/$old_library$dependency_libs" - continue - fi - - # This library was specified with -dlopen. - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking statically, - # we need to preload. - prev=dlprefiles - else - # We should not create a dependency on this library, but we - # may need any libraries it requires. - compile_command="$compile_command$dependency_libs" - finalize_command="$finalize_command$dependency_libs" - prev= - continue - fi - fi - - # The library was specified with -dlpreopen. - if test "$prev" = dlprefiles; then - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - dlprefiles="$dlprefiles $dir/$old_library" - else - dlprefiles="$dlprefiles $dir/$linklib" - fi - prev= - fi - - if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then - link_against_libtool_libs="$link_against_libtool_libs $arg" - if test -n "$shlibpath_var"; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath " in - *" $dir "*) ;; - *) temp_rpath="$temp_rpath $dir" ;; - esac - fi - - # We need an absolute path. - case "$dir" in - [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - absdir="$dir" - fi - ;; - esac - - # This is the magic to use -rpath. - # Skip directories that are in the system default run-time - # search path, unless they have been requested with -R. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - - lib_linked=yes - case "$hardcode_action" in - immediate | unsupported) - if test "$hardcode_direct" = no; then - compile_command="$compile_command $dir/$linklib" - deplibs="$deplibs $dir/$linklib" - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2*) - dllsearchdir=`cd "$dir" && pwd || echo "$dir"` - if test -n "$dllsearchpath"; then - dllsearchpath="$dllsearchpath:$dllsearchdir" - else - dllsearchpath="$dllsearchdir" - fi - ;; - esac - elif test "$hardcode_minus_L" = no; then - case "$host" in - *-*-sunos*) - compile_shlibpath="$compile_shlibpath$dir:" - ;; - esac - case "$compile_command " in - *" -L$dir "*) ;; - *) compile_command="$compile_command -L$dir";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -L$dir -l$name" - elif test "$hardcode_shlibpath_var" = no; then - case ":$compile_shlibpath:" in - *":$dir:"*) ;; - *) compile_shlibpath="$compile_shlibpath$dir:";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -l$name" - else - lib_linked=no - fi - ;; - - relink) - if test "$hardcode_direct" = yes; then - compile_command="$compile_command $absdir/$linklib" - deplibs="$deplibs $absdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - case "$compile_command " in - *" -L$absdir "*) ;; - *) compile_command="$compile_command -L$absdir";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -L$absdir -l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case ":$compile_shlibpath:" in - *":$absdir:"*) ;; - *) compile_shlibpath="$compile_shlibpath$absdir:";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -l$name" - else - lib_linked=no - fi - ;; - - *) - lib_linked=no - ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit 1 - fi - - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then - finalize_command="$finalize_command $libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - case "$finalize_command " in - *" -L$libdir "*) ;; - *) finalize_command="$finalize_command -L$libdir";; - esac - finalize_command="$finalize_command -l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case ":$finalize_shlibpath:" in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:";; - esac - finalize_command="$finalize_command -l$name" - else - # We cannot seem to hardcode it, guess we'll fake it. - case "$finalize_command " in - *" -L$dir "*) ;; - *) finalize_command="$finalize_command -L$libdir";; - esac - finalize_command="$finalize_command -l$name" - fi - else - # Transform directly to old archives if we don't build new libraries. - if test -n "$pic_flag" && test -z "$old_library"; then - $echo "$modename: cannot find static library for \`$arg'" 1>&2 - exit 1 - fi - - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_command="$compile_command $dir/$linklib" - finalize_command="$finalize_command $dir/$linklib" - else - case "$compile_command " in - *" -L$dir "*) ;; - *) compile_command="$compile_command -L$dir";; - esac - compile_command="$compile_command -l$name" - case "$finalize_command " in - *" -L$dir "*) ;; - *) finalize_command="$finalize_command -L$dir";; - esac - finalize_command="$finalize_command -l$name" - fi - fi - - # Add in any libraries that this one depends upon. - compile_command="$compile_command$dependency_libs" - finalize_command="$finalize_command$dependency_libs" - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - ;; - esac - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - done - - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" - - case "$output" in - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - - *.a | *.lib) - if test -n "$link_against_libtool_libs"; then - $echo "$modename: error: cannot link libtool libraries into archives" 1>&2 - exit 1 - fi - - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 - fi - - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 - fi - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - ;; - - *.la) - # Make sure we only generate libraries of the form `libNAME.la'. - case "$outputname" in - lib*) - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval libname=\"$libname_spec\" - ;; - *) - if test "$module" = no; then - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval libname=\"$libname_spec\" - else - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - fi - ;; - esac - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - - if test -n "$objs"; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1 - exit 1 - fi - - # How the heck are we supposed to write a wrapper for a shared library? - if test -n "$link_against_libtool_libs"; then - $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2 - exit 1 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2 - fi - - set dummy $rpath - if test $# -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - libext=al - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - dependency_libs="$deplibs" - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 - fi - else - - # Parse the version information argument. - IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - IFS="$save_ifs" - - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - current="$2" - revision="$3" - age="$4" - - # Check that each of the things are valid numbers. - case "$current" in - 0 | [1-9] | [1-9][0-9]*) ;; - *) - $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - case "$revision" in - 0 | [1-9] | [1-9][0-9]*) ;; - *) - $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - case "$age" in - 0 | [1-9] | [1-9][0-9]*) ;; - *) - $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - if test $age -gt $current; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case "$version_type" in - none) ;; - - irix) - major=`expr $current - $age + 1` - versuffix="$major.$revision" - verstring="sgi$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test $loop != 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` - verstring="sgi$major.$iface:$verstring" - done - ;; - - linux) - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - ;; - - osf) - major=`expr $current - $age` - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test $loop != 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - - windows) - # Like Linux, but with '-' rather than '.', since we only - # want one extension on Windows 95. - major=`expr $current - $age` - versuffix="-$major-$age-$revision" - ;; - - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - verstring="0.0" - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - - dependency_libs="$deplibs" - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *) - # Add libc to deplibs on all other systems. - deplibs="$deplibs -lc" - ;; - esac - fi - - # Create the output directory, or remove our outputs if we need to. - if test -d $output_objdir; then - $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" - $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* - else - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test $status -ne 0 && test ! -d $output_objdir; then - exit $status - fi - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - if test "$build_libtool_libs" = yes; then - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case "$deplibs_check_method" in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behaviour. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $rm conftest.c - cat > conftest.c </dev/null` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null \ - | grep " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | sed 's/.* -> //'` - case "$potliblink" in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ - | sed 10q \ - | egrep "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - echo "*** Warning: This library needs some functionality provided by $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | - grep . >/dev/null; then - echo - if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - echo "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - # Get the real and link names of the library. - eval library_names=\"$library_names_spec\" - set dummy $library_names - realname="$2" - shift; shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - lib="$output_objdir/$realname" - for link - do - linknames="$linknames $link" - done - - # Ensure that we have .o objects for linkers which dislike .lo - # (e.g. aix) incase we are running --disable-static - for obj in $libobjs; do - oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"` - if test ! -f $oldobj; then - $show "${LN_S} $obj $oldobj" - $run ${LN_S} $obj $oldobj || exit $? - fi - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - eval cmds=\"$export_symbols_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - if test -n "$export_symbols_regex"; then - $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" - $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - $show "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "mkdir $gentop" - $run mkdir "$gentop" - status=$? - if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - for xlib in $convenience; do - # Extract the objects. - case "$xlib" in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - - libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` - done - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linkopts="$linkopts $flag" - fi - - # Do each of the archive commands. - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval cmds=\"$archive_expsym_cmds\" - else - eval cmds=\"$archive_cmds\" - fi - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - *.lo | *.o | *.obj) - if test -n "$link_against_libtool_libs"; then - $echo "$modename: error: cannot link libtool libraries into objects" 1>&2 - exit 1 - fi - - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 - fi - - case "$output" in - *.lo) - if test -n "$objs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit 1 - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $run $rm $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${obj}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "mkdir $gentop" - $run mkdir "$gentop" - status=$? - if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - for xlib in $convenience; do - # Extract the objects. - case "$xlib" in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - - reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` - done - fi - fi - - # Create the old-style object. - reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" - - output="$obj" - eval cmds=\"$reload_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit 0 - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - $show "echo timestamp > $libobj" - $run eval "echo timestamp > $libobj" || exit $? - exit 0 - fi - - if test -n "$pic_flag"; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - eval cmds=\"$reload_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - else - # Just create a symlink. - $show $rm $libobj - $run $rm $libobj - $show "$LN_S $obj $libobj" - $run $LN_S $obj $libobj || exit $? - fi - - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit 0 - ;; - - # Anything else should be a program. - *) - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 - fi - - if test "$preload" = yes; then - if test "$dlopen" = unknown && test "$dlopen_self" = unknown && - test "$dlopen_self_static" = unknown; then - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi - fi - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$compile_rpath " in - *" $libdir "*) ;; - *) compile_rpath="$compile_rpath $libdir" ;; - esac - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - - # Create the binary in the object directory, then wrap it. - if test ! -d $output_objdir; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test $status -ne 0 && test ! -d $output_objdir; then - exit $status - fi - fi - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - dlsyms="${outputname}S.c" - else - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 - fi - fi - - if test -n "$dlsyms"; then - case "$dlsyms" in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${outputname}.nm" - - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - - # Parse the name list into a source file. - $show "creating $output_objdir/$dlsyms" - - test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* Prevent the only kind of declaration conflicts we can make. */ -#define lt_preloaded_symbols some_other_symbol - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - $show "generating symbol list for \`$output'" - - test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - if test -n "$export_symbols_regex"; then - $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$output.exp" - $run $rm $export_symbols - $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - else - $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' - $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - fi - fi - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" - name=`echo "$arg" | sed -e 's%^.*/%%'` - $run eval 'echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -z "$run"; then - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $mv "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then - : - else - grep -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' - else - echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ - -#undef lt_preloaded_symbols - -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{\ -" - - sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \ - -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \ - < "$nlist" >> "$output_objdir/$dlsyms" - - $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr_t) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - fi - - pic_flag_for_symtable= - case "$host" in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; - esac - esac - - # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" - $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" - - # Transform the symbol file into the correct name. - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit 1 - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` - fi - - if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - $show "$link_command" - $run eval "$link_command" - status=$? - - # Delete the generated files. - if test -n "$dlsyms"; then - $show "$rm $output_objdir/${outputname}S.${objext}" - $run $rm "$output_objdir/${outputname}S.${objext}" - fi - - exit $status - fi - - if test -n "$shlibpath_var"; then - # We should set the shlibpath_var - rpath= - for dir in $temp_rpath; do - case "$dir" in - [\\/]* | [A-Za-z]:[\\/]*) - # Absolute path. - rpath="$rpath$dir:" - ;; - *) - # Relative path: add a thisdir entry. - rpath="$rpath\$thisdir/$dir:" - ;; - esac - done - temp_rpath="$rpath" - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 - $echo "$modename: \`$output' will be relinked during installation" 1>&2 - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname - - $show "$link_command" - $run eval "$link_command" || exit $? - - # Now create the wrapper script. - $show "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $echo for shipping. - if test "X$echo" = "X$SHELL $0 --fallback-echo"; then - case "$0" in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; - *) qecho="$SHELL `pwd`/$0 --fallback-echo";; - esac - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if our run command is non-null. - if test -z "$run"; then - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) output=`echo $output|sed 's,.exe$,,'` ;; - esac - $rm $output - trap "$rm $output; exit 1" 1 2 15 - - $echo > $output "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -sed_quote_subst='$sed_quote_subst' - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variable: - link_against_libtool_libs='$link_against_libtool_libs' -else - # When we are sourced in execute mode, \$file and \$echo are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - echo=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$echo works! - : - else - # Restart under the correct shell, and then maybe \$echo will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $echo >> $output "\ - - # Find the directory that this script lives in. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - echo >> $output "\ - program=lt-'$outputname' - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || \\ - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $mkdir \"\$progdir\" - else - $rm \"\$progdir/\$file\" - fi" - - echo >> $output "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if (cd \"\$thisdir\" && eval \$relink_command); then : - else - $rm \"\$progdir/\$file\" - exit 1 - fi - fi - - $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $rm \"\$progdir/\$program\"; - $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $rm \"\$progdir/\$file\" - fi" - else - echo >> $output "\ - program='$outputname$exeext' - progdir=\"\$thisdir/$objdir\" -" - fi - - echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $echo >> $output "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $echo >> $output "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - *-*-cygwin* | *-*-mingw | *-*-os2*) - # win32 systems need to use the prog path for dll - # lookup to work - $echo >> $output "\ - exec \$progdir\\\\\$program \${1+\"\$@\"} -" - ;; - *) - $echo >> $output "\ - # Export the path to the program. - PATH=\"\$progdir:\$PATH\" - export PATH - - exec \$program \${1+\"\$@\"} -" - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" - exit 1 - fi - else - # The program doesn't exist. - \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 - \$echo \"This script is just a wrapper for \$program.\" 1>&2 - echo \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" - chmod +x $output - fi - exit 0 - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "mkdir $gentop" - $run mkdir "$gentop" - status=$? - if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - # Add in members from convenience archives. - for xlib in $addlibs; do - # Extract the objects. - case "$xlib" in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - - oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` - done - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - eval cmds=\"$old_archive_from_new_cmds\" - else - # Ensure that we have .o objects in place incase we decided - # not to build a shared library, and have fallen back to building - # static libs even though --disable-static was passed! - for oldobj in $oldobjs; do - if test ! -f $oldobj; then - obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"` - $show "${LN_S} $obj $oldobj" - $run ${LN_S} $obj $oldobj || exit $? - fi - done - - eval cmds=\"$old_archive_cmds\" - fi - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$generated"; then - $show "${rm}r$generated" - $run ${rm}r$generated - fi - - # Now create the libtool archive. - case "$output" in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - $show "creating $output" - - if test -n "$xrpath"; then - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - done - dependency_libs="$temp_xrpath $dependency_libs" - fi - - # Only create the output if not a dry run. - if test -z "$run"; then - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - fi - $rm $output - $echo > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$dlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Directory that this library needs to be installed in: -libdir='$install_libdir'\ -" - done - fi - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $? - ;; - esac - exit 0 - ;; - - # libtool install mode - install) - modename="$modename: install" - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$arg " - arg="$1" - shift - else - install_prog= - arg="$nonopt" - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog$arg" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest="$arg" - continue - fi - - case "$arg" in - -d) isdir=yes ;; - -f) prev="-f" ;; - -g) prev="-g" ;; - -m) prev="-m" ;; - -o) prev="-o" ;; - -s) - stripme=" -s" - continue - ;; - -*) ;; - - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest="$arg" - continue - fi - ;; - esac - - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog $arg" - done - - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test -z "$files"; then - if test -z "$dest"; then - $echo "$modename: no file or destination specified" 1>&2 - else - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 - exit 1 - fi - - # Strip any trailing slash from the destination. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` - test "X$destdir" = "X$dest" && destdir=. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - - # Not a directory, so check to see that there is only one file specified. - set dummy $files - if test $# -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - fi - case "$destdir" in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case "$file" in - *.lo) ;; - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case "$file" in - *.a | *.lib) - # Do the static libraries later. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - library_names= - old_library= - # If there is no directory component, then add one. - case "$file" in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/" - test "X$dir" = "X$file/" && dir= - dir="$dir$objdir" - - # See the names of the shared library. - set dummy $library_names - if test -n "$2"; then - realname="$2" - shift - shift - - # Install the shared library and build the symlinks. - $show "$install_prog $dir/$realname $destdir/$realname" - $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $? - - if test $# -gt 0; then - # Delete the old symlinks, and create new ones. - for linkname - do - if test "$linkname" != "$realname"; then - $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - fi - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - eval cmds=\"$postinstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Install the pseudo-library for information purposes. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case "$destfile" in - *.lo) - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` - ;; - *.o | *.obj) - staticdest="$destfile" - destfile= - ;; - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - esac - - # Install the libtool object if requested. - if test -n "$destfile"; then - $show "$install_prog $file $destfile" - $run eval "$install_prog $file $destfile" || exit $? - fi - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - - $show "$install_prog $staticobj $staticdest" - $run eval "$install_prog \$staticobj \$staticdest" || exit $? - fi - exit 0 - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Do a test to see if this is really a libtool program. - if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - link_against_libtool_libs= - relink_command= - - # If there is no directory component, then add one. - case "$file" in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Check the variables that should have been set. - if test -z "$link_against_libtool_libs"; then - $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 - exit 1 - fi - - finalize=yes - for lib in $link_against_libtool_libs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - # If there is no directory component, then add one. - case "$lib" in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - fi - libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`" - if test -n "$libdir" && test ! -f "$libfile"; then - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 - finalize=no - fi - done - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes && test -z "$run"; then - tmpdir="/tmp" - test -n "$TMPDIR" && tmpdir="$TMPDIR" - tmpdir="$tmpdir/libtool-$$" - if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : - else - $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 - continue - fi - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - ${rm}r "$tmpdir" - continue - fi - file="$outputname" - else - $echo "$modename: warning: cannot relink \`$file'" 1>&2 - fi - else - # Install the binary that we compiled earlier. - file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - $show "$install_prog$stripme $file $destfile" - $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && ${rm}r "$tmpdir" - ;; - esac - done - - for file in $staticlibs; do - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - - # Do each command in the postinstall commands. - eval cmds=\"$old_postinstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$future_libdirs"; then - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 - fi - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" - exec $SHELL $0 --finish$current_libdirs - exit 1 - fi - - exit 0 - ;; - - # libtool finish mode - finish) - modename="$modename: finish" - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - eval cmds=\"$finish_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || admincmds="$admincmds - $cmd" - done - IFS="$save_ifs" - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $run eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - test "$show" = : && exit 0 - - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - echo " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use \`-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - echo " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - echo " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - echo - echo "See any operating system documentation about shared libraries for" - echo "more information, such as the ld(1) and ld.so(8) manual pages." - echo "----------------------------------------------------------------------" - exit 0 - ;; - - # libtool execute mode - execute) - modename="$modename: execute" - - # The first argument is the command name. - cmd="$nonopt" - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" - exit 1 - fi - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - dir= - case "$file" in - *.la) - # Check to see that this really is a libtool archive. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Read the libtool library. - dlname= - library_names= - - # If there is no directory component, then add one. - case "$file" in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" - continue - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit 1 - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - ;; - - *) - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case "$file" in - -*) ;; - *) - # Do a test to see if this is really a libtool program. - if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case "$file" in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` - args="$args \"$file\"" - done - - if test -z "$run"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - - # Restore saved enviroment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi - if test "${save_LANG+set}" = set; then - LANG="$save_LANG"; export LANG - fi - - # Now actually exec the command. - eval "exec \$cmd$args" - - $echo "$modename: cannot exec \$cmd$args" - exit 1 - else - # Display what would be done. - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" - $echo "$cmd$args" - exit 0 - fi - ;; - - # libtool uninstall mode - uninstall) - modename="$modename: uninstall" - rm="$nonopt" - files= - - for arg - do - case "$arg" in - -*) rm="$rm $arg" ;; - *) files="$files $arg" ;; - esac - done - - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - for file in $files; do - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - rmfiles="$file" - - case "$name" in - *.la) - # Possibly a libtool archive, so verify it. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $dir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library" - - $show "$rm $rmfiles" - $run $rm $rmfiles - - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - eval cmds=\"$postuninstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" - done - IFS="$save_ifs" - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - eval cmds=\"$old_postuninstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" - done - IFS="$save_ifs" - fi - - # FIXME: should reinstall the best remaining shared library. - fi - ;; - - *.lo) - if test "$build_old_libs" = yes; then - oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` - rmfiles="$rmfiles $dir/$oldobj" - fi - $show "$rm $rmfiles" - $run $rm $rmfiles - ;; - - *) - $show "$rm $rmfiles" - $run $rm $rmfiles - ;; - esac - done - exit 0 - ;; - - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 - exit 1 - ;; - esac - - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit 1 -fi # test -z "$show_help" - -# We need to display help for each of the modes. -case "$mode" in -"") $echo \ -"Usage: $modename [OPTION]... [MODE-ARG]... - -Provide generalized library-building support services. - - --config show all configuration variables - --debug enable verbose shell tracing --n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --finish same as \`--mode=finish' - --help display this help message and exit - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages - --version print version information - -MODE must be one of the following: - - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for -a more detailed description of MODE." - exit 0 - ;; - -compile) - $echo \ -"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -static always build a \`.o' file suitable for static linking - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - -execute) - $echo \ -"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - -finish) - $echo \ -"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - -install) - $echo \ -"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - -link) - $echo \ -"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - -uninstall) - $echo \ -"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - -*) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; -esac - -echo -$echo "Try \`$modename --help' for more information about other modes." - -exit 0 - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/license.txt b/license.txt new file mode 100644 index 00000000..f4762929 --- /dev/null +++ b/license.txt @@ -0,0 +1,45 @@ +D1x License + +Preamble +-------- + +This License is designed to allow the Descent programming community to +continue to have the Descent source open and available to anyone. + +Original Parallax License +------------------------- + +THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX +SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO +END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A +ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS +IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS +SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE +FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE +CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS +AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. +COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. + +We make no warranties as to the usability or correctness of this code. +------------------------- + +The D1x project is the combination of the original Parallax code and the +modifications and additions made to source code. While the original code is +only under the Original Parallax License the D1x project contains original +code that was not made by Parallax. This ADDED and/or CHANGED code has the +following added restrictions: + +1) By using this source you are agreeing to these terms. + +2) D1x and derived works may only be modified if ONE of the following is done: + + a) The modified version is placed under this license. The source + code used to create the modified version is freely and publicly + available under this license. + + b) The modified version is only used by the developer. + +3) D1X IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + diff --git a/ltconfig b/ltconfig deleted file mode 100644 index 5ce1abaa..00000000 --- a/ltconfig +++ /dev/null @@ -1,3022 +0,0 @@ -#! /bin/sh - -# ltconfig - Create a system-specific libtool. -# Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# A lot of this script is taken from autoconf-2.10. - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} -echo=echo -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec "$SHELL" "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null`} - case X$UNAME in - *-DOS) PATH_SEPARATOR=';' ;; - *) PATH_SEPARATOR=':' ;; - esac -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi - -if test "X${echo_test_string+set}" != "Xset"; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string="`eval $cmd`") 2>/dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" != 'X\t' || - test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH /usr/ucb; do - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running ltconfig again with it. - ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - echo='printf "%s\n"' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - # Cool, printf works - : - elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && - test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL $0 --fallback-echo" - elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && - test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - echo="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# The name of this program. -progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` - -# Constants: -PROGRAM=ltconfig -PACKAGE=libtool -VERSION=1.3.3 -TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)" -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5' -rm="rm -f" - -help="Try \`$progname --help' for more information." - -# Global variables: -default_ofile=libtool -can_build_shared=yes -enable_shared=yes -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -enable_static=yes -enable_fast_install=yes -enable_dlopen=unknown -enable_win32_dll=no -ltmain= -silent= -srcdir= -ac_config_guess= -ac_config_sub= -host= -nonopt= -ofile="$default_ofile" -verify_host=yes -with_gcc=no -with_gnu_ld=no -need_locks=yes -ac_ext=c -objext=o -libext=a -exeext= -cache_file= - -old_AR="$AR" -old_CC="$CC" -old_CFLAGS="$CFLAGS" -old_CPPFLAGS="$CPPFLAGS" -old_LDFLAGS="$LDFLAGS" -old_LD="$LD" -old_LN_S="$LN_S" -old_LIBS="$LIBS" -old_NM="$NM" -old_RANLIB="$RANLIB" -old_DLLTOOL="$DLLTOOL" -old_OBJDUMP="$OBJDUMP" -old_AS="$AS" - -# Parse the command line options. -args= -prev= -for option -do - case "$option" in - -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - eval "$prev=\$option" - prev= - continue - fi - - case "$option" in - --help) cat <&2 - echo "$help" 1>&2 - exit 1 - ;; - - *) - if test -z "$ltmain"; then - ltmain="$option" - elif test -z "$host"; then -# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 -# if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then -# echo "$progname: warning \`$option' is not a valid host type" 1>&2 -# fi - host="$option" - else - echo "$progname: too many arguments" 1>&2 - echo "$help" 1>&2 - exit 1 - fi ;; - esac -done - -if test -z "$ltmain"; then - echo "$progname: you must specify a LTMAIN file" 1>&2 - echo "$help" 1>&2 - exit 1 -fi - -if test ! -f "$ltmain"; then - echo "$progname: \`$ltmain' does not exist" 1>&2 - echo "$help" 1>&2 - exit 1 -fi - -# Quote any args containing shell metacharacters. -ltconfig_args= -for arg -do - case "$arg" in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ltconfig_args="$ltconfig_args '$arg'" ;; - *) ltconfig_args="$ltconfig_args $arg" ;; - esac -done - -# A relevant subset of AC_INIT. - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 5 compiler messages saved in config.log -# 6 checking for... messages and results -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>>./config.log - -# NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LANG+set}" = set; then LANG=C; export LANG; fi - -if test -n "$cache_file" && test -r "$cache_file"; then - echo "loading cache $cache_file within ltconfig" - . $cache_file -fi - -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - -if test -z "$srcdir"; then - # Assume the source directory is the same one as the path to LTMAIN. - srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` - test "$srcdir" = "$ltmain" && srcdir=. -fi - -trap "$rm conftest*; exit 1" 1 2 15 -if test "$verify_host" = yes; then - # Check for config.guess and config.sub. - ac_aux_dir= - for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/config.guess; then - ac_aux_dir=$ac_dir - break - fi - done - if test -z "$ac_aux_dir"; then - echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 - echo "$help" 1>&2 - exit 1 - fi - ac_config_guess=$ac_aux_dir/config.guess - ac_config_sub=$ac_aux_dir/config.sub - - # Make sure we can run config.sub. - if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : - else - echo "$progname: cannot run $ac_config_sub" 1>&2 - echo "$help" 1>&2 - exit 1 - fi - - echo $ac_n "checking host system type""... $ac_c" 1>&6 - - host_alias=$host - case "$host_alias" in - "") - if host_alias=`$SHELL $ac_config_guess`; then : - else - echo "$progname: cannot guess host type; you must specify one" 1>&2 - echo "$help" 1>&2 - exit 1 - fi ;; - esac - host=`$SHELL $ac_config_sub $host_alias` - echo "$ac_t$host" 1>&6 - - # Make sure the host verified. - test -z "$host" && exit 1 - -elif test -z "$host"; then - echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 - echo "$help" 1>&2 - exit 1 -else - host_alias=$host -fi - -# Transform linux* to *-*-linux-gnu*, to support old configure scripts. -case "$host_os" in -linux-gnu*) ;; -linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` -esac - -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - -case "$host_os" in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "${COLLECT_NAMES+set}" != set; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR cru $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -# Set a sane default for `AR'. -test -z "$AR" && AR=ar - -# Set a sane default for `OBJDUMP'. -test -z "$OBJDUMP" && OBJDUMP=objdump - -# If RANLIB is not set, then run the test. -if test "${RANLIB+set}" != "set"; then - result=no - - echo $ac_n "checking for ranlib... $ac_c" 1>&6 - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then - RANLIB="ranlib" - result="ranlib" - break - fi - done - IFS="$save_ifs" - - echo "$ac_t$result" 1>&6 -fi - -if test -n "$RANLIB"; then - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" -fi - -# Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin. -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$AS" && AS=as - -# Check to see if we are using GCC. -if test "$with_gcc" != yes || test -z "$CC"; then - # If CC is not set, then try to find GCC or a usable CC. - if test -z "$CC"; then - echo $ac_n "checking for gcc... $ac_c" 1>&6 - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then - CC="gcc" - break - fi - done - IFS="$save_ifs" - - if test -n "$CC"; then - echo "$ac_t$CC" 1>&6 - else - echo "$ac_t"no 1>&6 - fi - fi - - # Not "gcc", so try "cc", rejecting "/usr/ucb/cc". - if test -z "$CC"; then - echo $ac_n "checking for cc... $ac_c" 1>&6 - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - cc_rejected=no - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/cc || test -f $dir/cc$ac_exeext; then - if test "$dir/cc" = "/usr/ucb/cc"; then - cc_rejected=yes - continue - fi - CC="cc" - break - fi - done - IFS="$save_ifs" - if test $cc_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same name, so the bogon will be chosen - # first if we set CC to just the name; use the full file name. - shift - set dummy "$dir/cc" "$@" - shift - CC="$@" - fi - fi - - if test -n "$CC"; then - echo "$ac_t$CC" 1>&6 - else - echo "$ac_t"no 1>&6 - fi - - if test -z "$CC"; then - echo "$progname: error: no acceptable cc found in \$PATH" 1>&2 - exit 1 - fi - fi - - # Now see if the compiler is really GCC. - with_gcc=no - echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 - echo "$progname:581: checking whether we are using GNU C" >&5 - - $rm conftest.c - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - with_gcc=yes - fi - $rm conftest.c - echo "$ac_t$with_gcc" 1>&6 -fi - -# Allow CC to be a program name with arguments. -set dummy $CC -compiler="$2" - -echo $ac_n "checking for object suffix... $ac_c" 1>&6 -$rm conftest* -echo 'int i = 1;' > conftest.c -echo "$progname:603: checking for object suffix" >& 5 -if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then - # Append any warnings to the config.log. - cat conftest.err 1>&5 - - for ac_file in conftest.*; do - case $ac_file in - *.c) ;; - *) objext=`echo $ac_file | sed -e s/conftest.//` ;; - esac - done -else - cat conftest.err 1>&5 - echo "$progname: failed program was:" >&5 - cat conftest.c >&5 -fi -$rm conftest* -echo "$ac_t$objext" 1>&6 - -echo $ac_n "checking for executable suffix... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_cv_exeext="no" - $rm conftest* - echo 'main () { return 0; }' > conftest.c - echo "$progname:629: checking for executable suffix" >& 5 - if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then - # Append any warnings to the config.log. - cat conftest.err 1>&5 - - for ac_file in conftest.*; do - case $ac_file in - *.c | *.err | *.$objext ) ;; - *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;; - esac - done - else - cat conftest.err 1>&5 - echo "$progname: failed program was:" >&5 - cat conftest.c >&5 - fi - $rm conftest* -fi -if test "X$ac_cv_exeext" = Xno; then - exeext="" -else - exeext="$ac_cv_exeext" -fi -echo "$ac_t$ac_cv_exeext" 1>&6 - -echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 -pic_flag= -special_shlib_compile_flags= -wl= -link_static_flag= -no_builtin_flag= - -if test "$with_gcc" = yes; then - wl='-Wl,' - link_static_flag='-static' - - case "$host_os" in - beos* | irix5* | irix6* | osf3* | osf4*) - # PIC is the default for these OSes. - ;; - aix*) - # Below there is a dirty hack to force normal static linking with -ldl - # The problem is because libdl dynamically linked with both libc and - # libC (AIX C++ library), which obviously doesn't included in libraries - # list by gcc. This cause undefined symbols with -static flags. - # This hack allows C programs to be linked with "-static -ldl", but - # we not sure about C++ programs. - link_static_flag="$link_static_flag ${wl}-lC" - ;; - cygwin* | mingw* | os2*) - # We can build DLLs from non-PIC. - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - pic_flag='-m68020 -resident32 -malways-restore-a4' - ;; - sysv4*MP*) - if test -d /usr/nec; then - pic_flag=-Kconform_pic - fi - ;; - *) - pic_flag='-fPIC' - ;; - esac -else - # PORTME Check for PIC flags for the system compiler. - case "$host_os" in - aix3* | aix4*) - # All AIX code is PIC. - link_static_flag='-bnso -bI:/lib/syscalls.exp' - ;; - - hpux9* | hpux10* | hpux11*) - # Is there a better link_static_flag that works with the bundled CC? - wl='-Wl,' - link_static_flag="${wl}-a ${wl}archive" - pic_flag='+Z' - ;; - - irix5* | irix6*) - wl='-Wl,' - link_static_flag='-non_shared' - # PIC (with -KPIC) is the default. - ;; - - cygwin* | mingw* | os2*) - # We can build DLLs from non-PIC. - ;; - - osf3* | osf4*) - # All OSF/1 code is PIC. - wl='-Wl,' - link_static_flag='-non_shared' - ;; - - sco3.2v5*) - pic_flag='-Kpic' - link_static_flag='-dn' - special_shlib_compile_flags='-belf' - ;; - - solaris*) - pic_flag='-KPIC' - link_static_flag='-Bstatic' - wl='-Wl,' - ;; - - sunos4*) - pic_flag='-PIC' - link_static_flag='-Bstatic' - wl='-Qoption ld ' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - pic_flag='-KPIC' - link_static_flag='-Bstatic' - wl='-Wl,' - ;; - - uts4*) - pic_flag='-pic' - link_static_flag='-Bstatic' - ;; - sysv4*MP*) - if test -d /usr/nec ;then - pic_flag='-Kconform_pic' - link_static_flag='-Bstatic' - fi - ;; - *) - can_build_shared=no - ;; - esac -fi - -if test -n "$pic_flag"; then - echo "$ac_t$pic_flag" 1>&6 - - # Check to make sure the pic_flag actually works. - echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6 - $rm conftest* - echo "int some_variable = 0;" > conftest.c - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $pic_flag -DPIC" - echo "$progname:776: checking if $compiler PIC flag $pic_flag works" >&5 - if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then - # Append any warnings to the config.log. - cat conftest.err 1>&5 - - case "$host_os" in - hpux9* | hpux10* | hpux11*) - # On HP-UX, both CC and GCC only warn that PIC is supported... then they - # create non-PIC objects. So, if there were any warnings, we assume that - # PIC is not supported. - if test -s conftest.err; then - echo "$ac_t"no 1>&6 - can_build_shared=no - pic_flag= - else - echo "$ac_t"yes 1>&6 - pic_flag=" $pic_flag" - fi - ;; - *) - echo "$ac_t"yes 1>&6 - pic_flag=" $pic_flag" - ;; - esac - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - can_build_shared=no - pic_flag= - echo "$ac_t"no 1>&6 - fi - CFLAGS="$save_CFLAGS" - $rm conftest* -else - echo "$ac_t"none 1>&6 -fi - -# Check to see if options -o and -c are simultaneously supported by compiler -echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6 -$rm -r conftest 2>/dev/null -mkdir conftest -cd conftest -$rm conftest* -echo "int some_variable = 0;" > conftest.c -mkdir out -# According to Tom Tromey, Ian Lance Taylor reported there are C compilers -# that will create temporary files in the current directory regardless of -# the output directory. Thus, making CWD read-only will cause this test -# to fail, enabling locking or at least warning the user not to do parallel -# builds. -chmod -w . -save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -o out/conftest2.o" -echo "$progname:829: checking if $compiler supports -c -o file.o" >&5 -if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then - - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s out/conftest.err; then - echo "$ac_t"no 1>&6 - compiler_c_o=no - else - echo "$ac_t"yes 1>&6 - compiler_c_o=yes - fi -else - # Append any errors to the config.log. - cat out/conftest.err 1>&5 - compiler_c_o=no - echo "$ac_t"no 1>&6 -fi -CFLAGS="$save_CFLAGS" -chmod u+w . -$rm conftest* out/* -rmdir out -cd .. -rmdir conftest -$rm -r conftest 2>/dev/null - -if test x"$compiler_c_o" = x"yes"; then - # Check to see if we can write to a .lo - echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6 - $rm conftest* - echo "int some_variable = 0;" > conftest.c - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -c -o conftest.lo" - echo "$progname:862: checking if $compiler supports -c -o file.lo" >&5 -if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then - - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - echo "$ac_t"no 1>&6 - compiler_o_lo=no - else - echo "$ac_t"yes 1>&6 - compiler_o_lo=yes - fi - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - compiler_o_lo=no - echo "$ac_t"no 1>&6 - fi - CFLAGS="$save_CFLAGS" - $rm conftest* -else - compiler_o_lo=no -fi - -# Check to see if we can do hard links to lock some files if needed -hard_links="nottested" -if test "$compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6 - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$ac_t$hard_links" 1>&6 - $rm conftest* - if test "$hard_links" = no; then - echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 - need_locks=warn - fi -else - need_locks=no -fi - -if test "$with_gcc" = yes; then - # Check to see if options -fno-rtti -fno-exceptions are supported by compiler - echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 - $rm conftest* - echo "int some_variable = 0;" > conftest.c - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c" - echo "$progname:914: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 - if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then - - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - echo "$ac_t"no 1>&6 - compiler_rtti_exceptions=no - else - echo "$ac_t"yes 1>&6 - compiler_rtti_exceptions=yes - fi - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - compiler_rtti_exceptions=no - echo "$ac_t"no 1>&6 - fi - CFLAGS="$save_CFLAGS" - $rm conftest* - - if test "$compiler_rtti_exceptions" = "yes"; then - no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' - else - no_builtin_flag=' -fno-builtin' - fi - -fi - -# Check for any special shared library compilation flags. -if test -n "$special_shlib_compile_flags"; then - echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2 - if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then : - else - echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2 - can_build_shared=no - fi -fi - -echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6 -$rm conftest* -echo 'main(){return(0);}' > conftest.c -save_LDFLAGS="$LDFLAGS" -LDFLAGS="$LDFLAGS $link_static_flag" -echo "$progname:958: checking if $compiler static flag $link_static_flag works" >&5 -if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - echo "$ac_t$link_static_flag" 1>&6 -else - echo "$ac_t"none 1>&6 - link_static_flag= -fi -LDFLAGS="$save_LDFLAGS" -$rm conftest* - -if test -z "$LN_S"; then - # Check to see if we can use ln -s, or we need hard links. - echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 - $rm conftest.dat - if ln -s X conftest.dat 2>/dev/null; then - $rm conftest.dat - LN_S="ln -s" - else - LN_S=ln - fi - if test "$LN_S" = "ln -s"; then - echo "$ac_t"yes 1>&6 - else - echo "$ac_t"no 1>&6 - fi -fi - -# Make sure LD is an absolute path. -if test -z "$LD"; then - ac_prog=ld - if test "$with_gcc" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6 - echo "$progname:991: checking for ld used by GCC" >&5 - ac_prog=`($CC -print-prog-name=ld) 2>&5` - case "$ac_prog" in - # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we are not using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac - elif test "$with_gnu_ld" = yes; then - echo $ac_n "checking for GNU ld... $ac_c" 1>&6 - echo "$progname:1015: checking for GNU ld" >&5 - else - echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 - echo "$progname:1018: checking for non-GNU ld" >&5 - fi - - if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" - fi - - if test -n "$LD"; then - echo "$ac_t$LD" 1>&6 - else - echo "$ac_t"no 1>&6 - fi - - if test -z "$LD"; then - echo "$progname: error: no acceptable ld found in \$PATH" 1>&2 - exit 1 - fi -fi - -# Check to see if it really is or is not GNU ld. -echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6 -# I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then - with_gnu_ld=yes -else - with_gnu_ld=no -fi -echo "$ac_t$with_gnu_ld" 1>&6 - -# See if the linker supports building shared libraries. -echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 - -allow_undefined_flag= -no_undefined_flag= -need_lib_prefix=unknown -need_version=unknown -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -archive_cmds= -archive_expsym_cmds= -old_archive_from_new_cmds= -export_dynamic_flag_spec= -whole_archive_flag_spec= -thread_safe_flag_spec= -hardcode_libdir_flag_spec= -hardcode_libdir_separator= -hardcode_direct=no -hardcode_minus_L=no -hardcode_shlibpath_var=unsupported -runpath_var= -always_export_symbols=no -export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' -# include_expsyms should be a list of space-separated symbols to be *always* -# included in the symbol list -include_expsyms= -# exclude_expsyms can be an egrep regular expression of symbols to exclude -# it will be wrapped by ` (' and `)$', so one must not match beginning or -# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', -# as well as any symbol that contains `d'. -exclude_expsyms="_GLOBAL_OFFSET_TABLE_" -# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out -# platforms (ab)use it in PIC code, but their linkers get confused if -# the symbol is explicitly referenced. Since portable code cannot -# rely on this symbol name, it's probably fine to never include it in -# preloaded symbol tables. - -case "$host_os" in -cygwin* | mingw*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$with_gcc" != yes; then - with_gnu_ld=no - fi - ;; - -esac - -ld_shlibs=yes -if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # See if GNU ld supports shared libraries. - case "$host_os" in - aix3* | aix4*) - # On AIX, the GNU linker is very broken - ld_shlibs=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - ;; - - amigaos*) - archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can use - # them. - ld_shlibs=no - ;; - - beos*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw*) - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=yes - - # Extract the symbol export list from an `--export-all' def file, - # then regenerate the def file from the symbol export list, so that - # the compiled dll only exports the symbol export list. - export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ - test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ - $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~ - sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols' - - archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ - _lt_hint=1; - for symbol in `cat $export_symbols`; do - echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def; - _lt_hint=`expr 1 + \$_lt_hint`; - done~ - test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ - test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ - $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ - $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ - $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts' - - old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' - ;; - - netbsd*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib' - # can we support soname and/or expsyms with a.out? -oliva - fi - ;; - - solaris*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - case $host_os in - cygwin* | mingw*) - # dlltool doesn't understand --whole-archive et. al. - whole_archive_flag_spec= - ;; - *) - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - ;; - esac - fi -else - # PORTME fill in a description of your system's linker (not GNU ld) - case "$host_os" in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$with_gcc" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix4*) - hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' - hardcode_libdir_separator=':' - if test "$with_gcc" = yes; then - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - shared_flag='-shared' - else - shared_flag='${wl}-bM:SRE' - hardcode_direct=yes - fi - allow_undefined_flag=' ${wl}-berok' - archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' - archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' - case "$host_os" in aix4.[01]|aix4.[01].*) - # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on - always_export_symbols=yes ;; - esac - ;; - - amigaos*) - archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - - cygwin* | mingw*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs' - fix_srcfile_path='`cygpath -w $srcfile`' - ;; - - freebsd1*) - ld_shlibs=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9* | hpux10* | hpux11*) - case "$host_os" in - hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;; - *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;; - esac - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_minus_L=yes # Not in the search PATH, but as the default - # location of the library. - export_dynamic_flag_spec='${wl}-E' - ;; - - irix5* | irix6*) - if test "$with_gcc" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF - fi - hardcode_libdir_flag_spec='${wl}-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - openbsd*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' - ;; - - osf3* | osf4*) - if test "$with_gcc" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - sco3.2v5*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - no_undefined_flag=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case "$host_os" in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - esac - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - # archive_cmds='$LD -G -z text -h $soname -o $lib$libobjs$deplibs' - archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - *) - ld_shlibs=no - ;; - esac -fi -echo "$ac_t$ld_shlibs" 1>&6 -test "$ld_shlibs" = no && can_build_shared=no - -if test -z "$NM"; then - echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 - case "$NM" in - [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path. - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - NM="$ac_dir/nm -B" - break - elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - NM="$ac_dir/nm -p" - break - else - NM=${NM="$ac_dir/nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - fi - fi - done - IFS="$ac_save_ifs" - test -z "$NM" && NM=nm - ;; - esac - echo "$ac_t$NM" 1>&6 -fi - -# Check for command to grab the raw symbol name followed by C symbol from nm. -echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Transform the above into a raw symbol and a C symbol. -symxfrm='\1 \2\3 \3' - -# Transform an extracted symbol line into a proper C declaration -global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" - -# Define system-specific variables. -case "$host_os" in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw*) - symcode='[ABCDGISTW]' - ;; -hpux*) # Its linker distinguishes data from code symbols - global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" - ;; -irix*) - symcode='[BCDEGRST]' - ;; -solaris*) - symcode='[BDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then - symcode='[ABCDGISTW]' -fi - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Write the raw and C identifiers. - global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - $rm conftest* - cat > conftest.c <&5 - if { (eval echo $progname:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then - # Now try to grab the symbols. - nlist=conftest.nm - if { echo "$progname:1596: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then - - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if egrep ' nm_test_var$' "$nlist" >/dev/null; then - if egrep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.c -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c' - - cat <> conftest.c -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{ -EOF - sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c - cat <<\EOF >> conftest.c - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$objext conftstm.$objext - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="conftstm.$objext" - CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo $progname:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - pipe_works=yes - else - echo "$progname: failed program was:" >&5 - cat conftest.c >&5 - fi - LIBS="$save_LIBS" - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.c >&5 - fi - $rm conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - global_symbol_pipe= - fi -done -if test "$pipe_works" = yes; then - echo "${ac_t}ok" 1>&6 -else - echo "${ac_t}failed" 1>&6 -fi - -if test -z "$global_symbol_pipe"; then - global_symbol_to_cdecl= -fi - -# Check hardcoding attributes. -echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var"; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$hardcode_shlibpath_var" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -echo "$ac_t$hardcode_action" 1>&6 - - -reload_flag= -reload_cmds='$LD$reload_flag -o $output$reload_objs' -echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6 -# PORTME Some linkers may need a different reload flag. -reload_flag='-r' -echo "$ac_t$reload_flag" 1>&6 -test -n "$reload_flag" && reload_flag=" $reload_flag" - -# PORTME Fill in your ld.so characteristics -library_names_spec= -libname_spec='lib$name' -soname_spec= -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -file_magic_cmd= -file_magic_test_file= -deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [regex]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given egrep regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. -echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 -case "$host_os" in -aix3*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}.so$major' - ;; - -aix4*) - version_type=linux - # AIX has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - # We preserve .a as extension for shared libraries though AIX4.2 - # and later linker supports .so - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a' - shlibpath_var=LIBPATH - deplibs_check_method=pass_all - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}.so' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - deplibs_check_method=pass_all - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - -bsdi4*) - version_type=linux - library_names_spec='${libname}.so$major ${libname}.so' - soname_spec='${libname}.so' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - file_magic_cmd=/usr/bin/file - file_magic_test_file=/shlib/libc.so - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw*) - version_type=windows - need_version=no - need_lib_prefix=no - if test "$with_gcc" = yes; then - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a' - else - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' - fi - dynamic_linker='Win32 ld.exe' - deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - file_magic_cmd='${OBJDUMP} -f' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case "$version_type" in - freebsd-elf*) - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /usr/lib/libc.so*` - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - deplibs_check_method=unknown - library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' - need_version=yes - ;; - esac - finish_cmds='PATH="\$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - case "$host_os" in - freebsd2* | freebsd3.[01]*) - shlibpath_overrides_runpath=yes - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - dynamic_linker="$host_os dld.sl" - version_type=sunos - need_lib_prefix=no - need_version=no - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' - soname_spec='${libname}${release}.sl$major' - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6*) - version_type=irix - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}.so.$major' - library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so' - case "$host_os" in - irix5*) - libsuff= shlibsuff= - # this will be overridden with pass_all, but let us keep it just in case - deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" - ;; - *) - case "$LD" in # libtool.m4 will add one of these switches to LD - *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - # this will be overridden with pass_all, but let us keep it just in case - deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /lib${libsuff}/libc.so*` - deplibs_check_method='pass_all' - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux-gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` - - if test -f /lib/ld.so.1; then - dynamic_linker='GNU ld.so' - else - # Only the GNU ld.so supports shared libraries on MkLinux. - case "$host_cpu" in - powerpc*) dynamic_linker=no ;; - *) dynamic_linker='Linux ld.so' ;; - esac - fi - ;; - -netbsd*) - version_type=sunos - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' - soname_spec='${libname}${release}.so$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - ;; - -openbsd*) - version_type=sunos - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - need_version=no - fi - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - ;; - -os2*) - libname_spec='$name' - need_lib_prefix=no - library_names_spec='$libname.dll $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4*) - version_type=osf - need_version=no - soname_spec='${libname}${release}.so' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - shlibpath_var=LD_LIBRARY_PATH - # this will be overridden with pass_all, but let us keep it just in case - deplibs_check_method='file_magic COFF format alpha shared library' - file_magic_cmd=/usr/bin/file - file_magic_test_file=/shlib/libc.so - deplibs_check_method='pass_all' - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib" - file_magic_cmd=/usr/bin/file - file_magic_test_file=/lib/libc.so - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - case "$host_vendor" in - ncr) - deplibs_check_method='pass_all' - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - esac - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' - soname_spec='$libname.so.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -*) - dynamic_linker=no - ;; -esac -echo "$ac_t$dynamic_linker" 1>&6 -test "$dynamic_linker" = no && can_build_shared=no - -# Report the final consequences. -echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 - -# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in -# configure.in, otherwise build static only libraries. -case "$host_os" in -cygwin* | mingw* | os2*) - if test x$can_build_shared = xyes; then - test x$enable_win32_dll = xno && can_build_shared=no - echo "checking if package supports dlls... $can_build_shared" 1>&6 - fi -;; -esac - -if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then - case "$deplibs_check_method" in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac -fi - -echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case "$host_os" in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4*) - test "$enable_shared" = yes && enable_static=no - ;; -esac - -echo "$ac_t$enable_shared" 1>&6 - -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes - -echo "checking whether to build static libraries... $enable_static" 1>&6 - -if test "$hardcode_action" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -echo $ac_n "checking for objdir... $ac_c" 1>&6 -rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - objdir=_libs -fi -rmdir .libs 2>/dev/null -echo "$ac_t$objdir" 1>&6 - -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else -if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then - lt_cv_dlopen=no lt_cv_dlopen_libs= -echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "$progname:2170: checking for dlopen in -ldl" >&5 -ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldl $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "$progname:2207: checking for dlopen" >&5 -if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_dlopen) || defined (__stub___dlopen) -choke me -#else -dlopen(); -#endif - -; return 0; } -EOF -if { (eval echo $progname:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_dlopen=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_dlopen=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 -echo "$progname:2251: checking for dld_link in -ldld" >&5 -ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldld $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "$progname:2288: checking for shl_load" >&5 -if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shl_load) || defined (__stub___shl_load) -choke me -#else -shl_load(); -#endif - -; return 0; } -EOF -if { (eval echo $progname:2315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_shl_load=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_shl_load=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="shl_load" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "$progname:2333: checking for shl_load in -ldld" >&5 -ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldld $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" -else - echo "$ac_t""no" 1>&6 -fi - - -fi - - -fi - - -fi - - -fi - -fi - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - fi - - case "$lt_cv_dlopen" in - dlopen) -for ac_hdr in dlfcn.h; do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "$progname:2395: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -int fnord = 0; -EOF -ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo $progname:2405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi -done - - if test "x$ac_cv_header_dlfcn_h" = xyes; then - CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - fi - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - LIBS="$lt_cv_dlopen_libs $LIBS" - - echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:2433: checking whether a program can dlopen itself" >&5 -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - lt_cv_dlopen_self=cross - else - cat > conftest.c < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LTDL_GLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LTDL_GLOBAL DL_GLOBAL -# else -# define LTDL_GLOBAL 0 -# endif -#endif - -/* We may have to define LTDL_LAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LTDL_LAZY_OR_NOW -# ifdef RTLD_LAZY -# define LTDL_LAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LTDL_LAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LTDL_LAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LTDL_LAZY_OR_NOW DL_NOW -# else -# define LTDL_LAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -fnord() { int i=42;} -main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); - if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); - if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } - -EOF -if { (eval echo $progname:2487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - lt_cv_dlopen_self=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - lt_cv_dlopen_self=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$lt_cv_dlopen_self" 1>&6 - - if test "$lt_cv_dlopen_self" = yes; then - LDFLAGS="$LDFLAGS $link_static_flag" - echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:2506: checking whether a statically linked program can dlopen itself" >&5 -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - lt_cv_dlopen_self_static=cross - else - cat > conftest.c < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LTDL_GLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LTDL_GLOBAL DL_GLOBAL -# else -# define LTDL_GLOBAL 0 -# endif -#endif - -/* We may have to define LTDL_LAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LTDL_LAZY_OR_NOW -# ifdef RTLD_LAZY -# define LTDL_LAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LTDL_LAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LTDL_LAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LTDL_LAZY_OR_NOW DL_NOW -# else -# define LTDL_LAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -fnord() { int i=42;} -main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); - if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); - if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } - -EOF -if { (eval echo $progname:2560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - lt_cv_dlopen_self_static=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - lt_cv_dlopen_self_static=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 -fi - ;; - esac - - case "$lt_cv_dlopen_self" in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case "$lt_cv_dlopen_self_static" in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - -# Copy echo and quote the copy, instead of the original, because it is -# used later. -ltecho="$echo" -if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then - ltecho="$CONFIG_SHELL \$0 --fallback-echo" -fi -LTSHELL="$SHELL" - -LTCONFIG_VERSION="$VERSION" - -# Only quote variables if we're using ltmain.sh. -case "$ltmain" in -*.sh) - # Now quote all the things that may contain metacharacters. - for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \ - old_LD old_LDFLAGS old_LIBS \ - old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \ - AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \ - reload_flag reload_cmds wl \ - pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ - thread_safe_flag_spec whole_archive_flag_spec libname_spec \ - library_names_spec soname_spec \ - RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ - old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \ - file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \ - finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ - hardcode_libdir_flag_spec hardcode_libdir_separator \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do - - case "$var" in - reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case "$ltecho" in - *'\$0 --fallback-echo"') - ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - - trap "$rm \"$ofile\"; exit 1" 1 2 15 - echo "creating $ofile" - $rm "$ofile" - cat < "$ofile" -#! $SHELL - -# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. -# -# Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="sed -e s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi - -### BEGIN LIBTOOL CONFIG -EOF - cfgfile="$ofile" - ;; - -*) - # Double-quote the variables that need it (for aesthetics). - for var in old_CC old_CFLAGS old_CPPFLAGS \ - old_LD old_LDFLAGS old_LIBS \ - old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do - eval "$var=\\\"\$var\\\"" - done - - # Just create a config file. - cfgfile="$ofile.cfg" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - echo "creating $cfgfile" - $rm "$cfgfile" - cat < "$cfgfile" -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -EOF - ;; -esac - -cat <> "$cfgfile" -# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ -# LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\ -# NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ -# DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\ -# $0$ltconfig_args -# -# Compiler and other test output produced by $progname, useful for -# debugging $progname, is in ./config.log if it exists. - -# The version of $progname that generated this script. -LTCONFIG_VERSION=$LTCONFIG_VERSION - -# Shell to use when invoking shell scripts. -SHELL=$LTSHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$ltecho - -# The archiver. -AR=$AR - -# The default C compiler. -CC=$CC - -# The linker used to build libraries. -LD=$LD - -# Whether we need hard or soft links. -LN_S=$LN_S - -# A BSD-compatible nm program. -NM=$NM - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$reload_flag -reload_cmds=$reload_cmds - -# How to pass a linker flag through the compiler. -wl=$wl - -# Object file suffix (normally "o"). -objext="$objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$pic_flag - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$compiler_c_o - -# Can we write directly to a .lo ? -compiler_o_lo=$compiler_o_lo - -# Must we lock files when doing compilation ? -need_locks=$need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$link_static_flag - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$no_builtin_flag - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$whole_archive_flag_spec - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$thread_safe_flag_spec - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$RANLIB -old_archive_cmds=$old_archive_cmds -old_postinstall_cmds=$old_postinstall_cmds -old_postuninstall_cmds=$old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$old_archive_from_new_cmds - -# Commands used to build and install a shared archive. -archive_cmds=$archive_cmds -archive_expsym_cmds=$archive_expsym_cmds -postinstall_cmds=$postinstall_cmds -postuninstall_cmds=$postuninstall_cmds - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$allow_undefined_flag - -# Flag that forces no undefined symbols. -no_undefined_flag=$no_undefined_flag - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$global_symbol_to_cdecl - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec -if test -f /etc/debian_version; then -# Debian policy mandates that rpaths should not be encoded into a binary -# so it is overridden. - hardcode_libdir_flag_spec=" -D_DEBIAN_PATCHED_LIBTOOL_ " -fi - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$hardcode_libdir_separator - -# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$export_symbols_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$include_expsyms - -EOF - -case "$ltmain" in -*.sh) - echo '### END LIBTOOL CONFIG' >> "$ofile" - echo >> "$ofile" - case "$host_os" in - aix3*) - cat <<\EOF >> "$ofile" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "${COLLECT_NAMES+set}" != set; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - # Append the ltmain.sh script. - sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) - - chmod +x "$ofile" - ;; - -*) - # Compile the libtool program. - echo "FIXME: would compile $ltmain" - ;; -esac - -test -n "$cache_file" || exit 0 - -# AC_CACHE_SAVE -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -exit 0 - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/ltmain.sh b/ltmain.sh deleted file mode 100644 index ae10cad0..00000000 --- a/ltmain.sh +++ /dev/null @@ -1,3975 +0,0 @@ -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun ltconfig. -# -# Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Check that we have a working $echo. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 -fi - -if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - echo "$modename: not configured to build any kind of library" 1>&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 -fi - -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" - -# Parse our command line options once, thoroughly. -while test $# -gt 0 -do - arg="$1" - shift - - case "$arg" in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case "$prev" in - execute_dlfiles) - eval "$prev=\"\$$prev \$arg\"" - ;; - *) - eval "$prev=\$arg" - ;; - esac - - prev= - prevopt= - continue - fi - - # Have we seen a non-optional argument yet? - case "$arg" in - --help) - show_help=yes - ;; - - --version) - echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - exit 0 - ;; - - --config) - sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0 - exit 0 - ;; - - --debug) - echo "$progname: enabling shell trace mode" - set -x - ;; - - --dry-run | -n) - run=: - ;; - - --features) - echo "host: $host" - if test "$build_libtool_libs" = yes; then - echo "enable shared libraries" - else - echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - echo "enable static libraries" - else - echo "disable static libraries" - fi - exit 0 - ;; - - --finish) mode="finish" ;; - - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - - --quiet | --silent) - show=: - ;; - - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles - ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - - *) - nonopt="$arg" - break - ;; - esac -done - -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 -fi - -if test -z "$show_help"; then - - # Infer the operation mode. - if test -z "$mode"; then - case "$nonopt" in - *cc | *++ | gcc* | *-gcc*) - mode=link - for arg - do - case "$arg" in - -c) - mode=compile - break - ;; - esac - done - ;; - *db | *dbx | *strace | *truss) - mode=execute - ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute - - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi - fi - ;; - esac - fi - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." - - # These modes are in order of execution frequency so that they run quickly. - case "$mode" in - # libtool compile mode - compile) - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= - lastarg= - srcfile="$nonopt" - suppress_output= - - user_target=no - for arg - do - # Accept any command-line options. - case "$arg" in - -o) - if test "$user_target" != "no"; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit 1 - fi - user_target=next - ;; - - -static) - build_old_libs=yes - continue - ;; - esac - - case "$user_target" in - next) - # The next one is the -o target name - user_target=yes - continue - ;; - yes) - # We got the output file - user_target=set - libobj="$arg" - continue - ;; - esac - - # Accept the current argument as the source file. - lastarg="$srcfile" - srcfile="$arg" - - # Aesthetically quote the previous argument. - - # Backslashify any backslashes, double quotes, and dollar signs. - # These are the only characters that are still specially - # interpreted inside of double-quoted scrings. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly in scan - # sets, so we specify it separately. - case "$lastarg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - lastarg="\"$lastarg\"" - ;; - esac - - # Add the previous argument to base_compile. - if test -z "$base_compile"; then - base_compile="$lastarg" - else - base_compile="$base_compile $lastarg" - fi - done - - case "$user_target" in - set) - ;; - no) - # Get the name of the library object. - libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; - *) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit 1 - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - xform='[cCFSfmso]' - case "$libobj" in - *.ada) xform=ada ;; - *.adb) xform=adb ;; - *.ads) xform=ads ;; - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; - *.for) xform=for ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - - case "$libobj" in - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - exit 1 - ;; - esac - - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $libobj" - else - removelist="$libobj" - fi - - $run $rm $removelist - trap "$run $rm $removelist; exit 1" 1 2 15 - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext} - lockfile="$output_obj.lock" - removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit 1" 1 2 15 - else - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until ln "$0" "$lockfile" 2>/dev/null; do - $show "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - echo "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - echo $srcfile > "$lockfile" - fi - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - # All platforms use -DPIC, to notify preprocessed assembler code. - command="$base_compile $pic_flag -DPIC $srcfile" - if test "$build_old_libs" = yes; then - lo_libobj="$libobj" - dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$libobj"; then - dir="$objdir" - else - dir="$dir/$objdir" - fi - libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` - - if test -d "$dir"; then - $show "$rm $libobj" - $run $rm $libobj - else - $show "$mkdir $dir" - $run $mkdir $dir - status=$? - if test $status -ne 0 && test ! -d $dir; then - exit $status - fi - fi - fi - if test "$compiler_o_lo" = yes; then - output_obj="$libobj" - command="$command -o $output_obj" - elif test "$compiler_c_o" = yes; then - output_obj="$obj" - command="$command -o $output_obj" - fi - - $run $rm "$output_obj" - $show "$command" - if $run eval "$command"; then : - else - test -n "$output_obj" && $run $rm $removelist - exit 1 - fi - - if test "$need_locks" = warn && - test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then - echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - - # Just move the object if needed, then go on to compile the next one - if test x"$output_obj" != x"$libobj"; then - $show "$mv $output_obj $libobj" - if $run $mv $output_obj $libobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # If we have no pic_flag, then copy the object into place and finish. - if test -z "$pic_flag" && test "$build_old_libs" = yes; then - # Rename the .lo from within objdir to obj - if test -f $obj; then - $show $rm $obj - $run $rm $obj - fi - - $show "$mv $libobj $obj" - if $run $mv $libobj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - - # Now arrange that obj and lo_libobj become the same file - $show "$LN_S $obj $lo_libobj" - if $run $LN_S $obj $lo_libobj; then - exit 0 - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Allow error messages only from the first compilation. - suppress_output=' >/dev/null 2>&1' - fi - - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - command="$base_compile $srcfile" - if test "$compiler_c_o" = yes; then - command="$command -o $obj" - output_obj="$obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" - $run $rm "$output_obj" - $show "$command" - if $run eval "$command"; then : - else - $run $rm $removelist - exit 1 - fi - - if test "$need_locks" = warn && - test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then - echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - - # Just move the object if needed - if test x"$output_obj" != x"$obj"; then - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Create an invalid libtool object if no PIC, so that we do not - # accidentally link it into a program. - if test "$build_libtool_libs" != yes; then - $show "echo timestamp > $libobj" - $run eval "echo timestamp > \$libobj" || exit $? - else - # Move the .lo from within objdir - $show "$mv $libobj $lo_libobj" - if $run $mv $libobj $lo_libobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - fi - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - $rm "$lockfile" - fi - - exit 0 - ;; - - # libtool link mode - link) - modename="$modename: link" - C_compiler="$CC" # save it, to compile generated C sources - CC="$nonopt" - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invokation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - - # This is a source program that is used to create dlls on Windows - # Don't remove nor modify the starting and closing comments -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ - # This is a source program that is used to create import libraries - # on Windows for dlls which lack them. Don't remove nor modify the - # starting and closing comments -# /* impgen.c starts here */ -# /* Copyright (C) 1999 Free Software Foundation, Inc. -# -# This file is part of GNU libtool. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# */ -# -# #include /* for printf() */ -# #include /* for open(), lseek(), read() */ -# #include /* for O_RDONLY, O_BINARY */ -# #include /* for strdup() */ -# -# static unsigned int -# pe_get16 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[2]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 2); -# return b[0] + (b[1]<<8); -# } -# -# static unsigned int -# pe_get32 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[4]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 4); -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# static unsigned int -# pe_as32 (ptr) -# void *ptr; -# { -# unsigned char *b = ptr; -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# int -# main (argc, argv) -# int argc; -# char *argv[]; -# { -# int dll; -# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; -# unsigned long export_rva, export_size, nsections, secptr, expptr; -# unsigned long name_rvas, nexp; -# unsigned char *expdata, *erva; -# char *filename, *dll_name; -# -# filename = argv[1]; -# -# dll = open(filename, O_RDONLY|O_BINARY); -# if (!dll) -# return 1; -# -# dll_name = filename; -# -# for (i=0; filename[i]; i++) -# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') -# dll_name = filename + i +1; -# -# pe_header_offset = pe_get32 (dll, 0x3c); -# opthdr_ofs = pe_header_offset + 4 + 20; -# num_entries = pe_get32 (dll, opthdr_ofs + 92); -# -# if (num_entries < 1) /* no exports */ -# return 1; -# -# export_rva = pe_get32 (dll, opthdr_ofs + 96); -# export_size = pe_get32 (dll, opthdr_ofs + 100); -# nsections = pe_get16 (dll, pe_header_offset + 4 +2); -# secptr = (pe_header_offset + 4 + 20 + -# pe_get16 (dll, pe_header_offset + 4 + 16)); -# -# expptr = 0; -# for (i = 0; i < nsections; i++) -# { -# char sname[8]; -# unsigned long secptr1 = secptr + 40 * i; -# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); -# unsigned long vsize = pe_get32 (dll, secptr1 + 16); -# unsigned long fptr = pe_get32 (dll, secptr1 + 20); -# lseek(dll, secptr1, SEEK_SET); -# read(dll, sname, 8); -# if (vaddr <= export_rva && vaddr+vsize > export_rva) -# { -# expptr = fptr + (export_rva - vaddr); -# if (export_rva + export_size > vaddr + vsize) -# export_size = vsize - (export_rva - vaddr); -# break; -# } -# } -# -# expdata = (unsigned char*)malloc(export_size); -# lseek (dll, expptr, SEEK_SET); -# read (dll, expdata, export_size); -# erva = expdata - export_rva; -# -# nexp = pe_as32 (expdata+24); -# name_rvas = pe_as32 (expdata+32); -# -# printf ("EXPORTS\n"); -# for (i = 0; i&2 - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - else - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - fi - build_libtool_libs=no - build_old_libs=yes - prefer_static_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test $# -gt 0; do - arg="$1" - shift - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case "$prev" in - output) - compile_command="$compile_command @OUTPUT@" - finalize_command="$finalize_command @OUTPUT@" - ;; - esac - - case "$prev" in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command="$compile_command @SYMFILE@" - finalize_command="$finalize_command @SYMFILE@" - preload=yes - fi - case "$arg" in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - ;; - esac - ;; - expsyms) - export_symbols="$arg" - if test ! -f "$arg"; then - $echo "$modename: symbol file \`$arg' does not exist" - exit 1 - fi - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case "$arg" in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit 1 - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi - - prevarg="$arg" - - case "$arg" in - -all-static) - if test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 - continue - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: not more than one -exported-symbols argument allowed" - exit 1 - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -L*) - dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` - # We need an absolute path. - case "$dir" in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - absdir="$dir" - fi - dir="$absdir" - ;; - esac - case " $deplibs " in - *" $arg "*) ;; - *) deplibs="$deplibs $arg";; - esac - case " $lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir";; - esac - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2*) - dllsearchdir=`cd "$dir" && pwd || echo "$dir"` - case ":$dllsearchpath:" in - ::) dllsearchpath="$dllsearchdir";; - *":$dllsearchdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dllsearchdir";; - esac - ;; - esac - ;; - - -l*) - if test "$arg" = "-lc"; then - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) - # These systems don't actually have c library (as such) - continue - ;; - esac - elif test "$arg" = "-lm"; then - case "$host" in - *-*-cygwin* | *-*-beos*) - # These systems don't actually have math library (as such) - continue - ;; - esac - fi - deplibs="$deplibs $arg" - ;; - - -module) - module=yes - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -o) prev=output ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` - # We need an absolute path. - case "$dir" in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit 1 - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -static) - # If we have no pic_flag, then this is the same as -all-static. - if test -z "$pic_flag" && test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - - # Some other compiler flag. - -* | +*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - ;; - - *.o | *.obj | *.a | *.lib) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A library object. - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` - prev= - fi - libobjs="$libobjs $arg" - ;; - - *.la) - # A libtool-controlled library. - - dlname= - libdir= - library_names= - old_library= - - # Check to see that this really is a libtool archive. - if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2 - exit 1 - fi - - # If the library was installed with an old release of libtool, - # it will not redefine variable installed. - installed=yes - - # Read the .la file - # If there is no directory component, then add one. - case "$arg" in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$arg'" 1>&2 - exit 1 - fi - - # Find the relevant object directory and library name. - name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'` - - if test "X$installed" = Xyes; then - dir="$libdir" - else - dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$arg"; then - dir="$objdir" - else - dir="$dir/$objdir" - fi - fi - - if test -n "$dependency_libs"; then - # Extract -R and -L from dependency_libs - temp_deplibs= - for deplib in $dependency_libs; do - case "$deplib" in - -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - case " $rpath $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - -L*) case "$compile_command $temp_deplibs " in - *" $deplib "*) ;; - *) temp_deplibs="$temp_deplibs $deplib";; - esac - temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'` - case " $lib_search_path " in - *" $temp_dir "*) ;; - *) lib_search_path="$lib_search_path $temp_dir";; - esac - ;; - *) temp_deplibs="$temp_deplibs $deplib";; - esac - done - dependency_libs="$temp_deplibs" - fi - - if test -z "$libdir"; then - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $dir/$old_library" - old_convenience="$old_convenience $dir/$old_library" - deplibs="$deplibs$dependency_libs" - compile_command="$compile_command $dir/$old_library$dependency_libs" - finalize_command="$finalize_command $dir/$old_library$dependency_libs" - continue - fi - - # This library was specified with -dlopen. - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking statically, - # we need to preload. - prev=dlprefiles - else - # We should not create a dependency on this library, but we - # may need any libraries it requires. - compile_command="$compile_command$dependency_libs" - finalize_command="$finalize_command$dependency_libs" - prev= - continue - fi - fi - - # The library was specified with -dlpreopen. - if test "$prev" = dlprefiles; then - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - dlprefiles="$dlprefiles $dir/$old_library" - else - dlprefiles="$dlprefiles $dir/$linklib" - fi - prev= - fi - - if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then - link_against_libtool_libs="$link_against_libtool_libs $arg" - if test -n "$shlibpath_var"; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath " in - *" $dir "*) ;; - *) temp_rpath="$temp_rpath $dir" ;; - esac - fi - - # We need an absolute path. - case "$dir" in - [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - absdir="$dir" - fi - ;; - esac - - # This is the magic to use -rpath. - # Skip directories that are in the system default run-time - # search path, unless they have been requested with -R. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - - lib_linked=yes - case "$hardcode_action" in - immediate | unsupported) - if test "$hardcode_direct" = no; then - compile_command="$compile_command $dir/$linklib" - deplibs="$deplibs $dir/$linklib" - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2*) - dllsearchdir=`cd "$dir" && pwd || echo "$dir"` - if test -n "$dllsearchpath"; then - dllsearchpath="$dllsearchpath:$dllsearchdir" - else - dllsearchpath="$dllsearchdir" - fi - ;; - esac - elif test "$hardcode_minus_L" = no; then - case "$host" in - *-*-sunos*) - compile_shlibpath="$compile_shlibpath$dir:" - ;; - esac - case "$compile_command " in - *" -L$dir "*) ;; - *) compile_command="$compile_command -L$dir";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -L$dir -l$name" - elif test "$hardcode_shlibpath_var" = no; then - case ":$compile_shlibpath:" in - *":$dir:"*) ;; - *) compile_shlibpath="$compile_shlibpath$dir:";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -l$name" - else - lib_linked=no - fi - ;; - - relink) - if test "$hardcode_direct" = yes; then - compile_command="$compile_command $absdir/$linklib" - deplibs="$deplibs $absdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - case "$compile_command " in - *" -L$absdir "*) ;; - *) compile_command="$compile_command -L$absdir";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -L$absdir -l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case ":$compile_shlibpath:" in - *":$absdir:"*) ;; - *) compile_shlibpath="$compile_shlibpath$absdir:";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -l$name" - else - lib_linked=no - fi - ;; - - *) - lib_linked=no - ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit 1 - fi - - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then - finalize_command="$finalize_command $libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - case "$finalize_command " in - *" -L$libdir "*) ;; - *) finalize_command="$finalize_command -L$libdir";; - esac - finalize_command="$finalize_command -l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case ":$finalize_shlibpath:" in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:";; - esac - finalize_command="$finalize_command -l$name" - else - # We cannot seem to hardcode it, guess we'll fake it. - case "$finalize_command " in - *" -L$dir "*) ;; - *) finalize_command="$finalize_command -L$libdir";; - esac - finalize_command="$finalize_command -l$name" - fi - else - # Transform directly to old archives if we don't build new libraries. - if test -n "$pic_flag" && test -z "$old_library"; then - $echo "$modename: cannot find static library for \`$arg'" 1>&2 - exit 1 - fi - - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_command="$compile_command $dir/$linklib" - finalize_command="$finalize_command $dir/$linklib" - else - case "$compile_command " in - *" -L$dir "*) ;; - *) compile_command="$compile_command -L$dir";; - esac - compile_command="$compile_command -l$name" - case "$finalize_command " in - *" -L$dir "*) ;; - *) finalize_command="$finalize_command -L$dir";; - esac - finalize_command="$finalize_command -l$name" - fi - fi - - # Add in any libraries that this one depends upon. - compile_command="$compile_command$dependency_libs" - finalize_command="$finalize_command$dependency_libs" - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - ;; - esac - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - done - - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" - - case "$output" in - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - - *.a | *.lib) - if test -n "$link_against_libtool_libs"; then - $echo "$modename: error: cannot link libtool libraries into archives" 1>&2 - exit 1 - fi - - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 - fi - - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 - fi - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - ;; - - *.la) - # Make sure we only generate libraries of the form `libNAME.la'. - case "$outputname" in - lib*) - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval libname=\"$libname_spec\" - ;; - *) - if test "$module" = no; then - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval libname=\"$libname_spec\" - else - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - fi - ;; - esac - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - - if test -n "$objs"; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1 - exit 1 - fi - - # How the heck are we supposed to write a wrapper for a shared library? - if test -n "$link_against_libtool_libs"; then - $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2 - exit 1 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2 - fi - - set dummy $rpath - if test $# -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - libext=al - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - dependency_libs="$deplibs" - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 - fi - else - - # Parse the version information argument. - IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - IFS="$save_ifs" - - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - current="$2" - revision="$3" - age="$4" - - # Check that each of the things are valid numbers. - case "$current" in - 0 | [1-9] | [1-9][0-9]*) ;; - *) - $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - case "$revision" in - 0 | [1-9] | [1-9][0-9]*) ;; - *) - $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - case "$age" in - 0 | [1-9] | [1-9][0-9]*) ;; - *) - $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - if test $age -gt $current; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case "$version_type" in - none) ;; - - irix) - major=`expr $current - $age + 1` - versuffix="$major.$revision" - verstring="sgi$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test $loop != 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` - verstring="sgi$major.$iface:$verstring" - done - ;; - - linux) - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - ;; - - osf) - major=`expr $current - $age` - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test $loop != 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - - windows) - # Like Linux, but with '-' rather than '.', since we only - # want one extension on Windows 95. - major=`expr $current - $age` - versuffix="-$major-$age-$revision" - ;; - - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - verstring="0.0" - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - - dependency_libs="$deplibs" - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *) - # Add libc to deplibs on all other systems. - deplibs="$deplibs -lc" - ;; - esac - fi - - # Create the output directory, or remove our outputs if we need to. - if test -d $output_objdir; then - $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" - $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* - else - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test $status -ne 0 && test ! -d $output_objdir; then - exit $status - fi - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - if test "$build_libtool_libs" = yes; then - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case "$deplibs_check_method" in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behaviour. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $rm conftest.c - cat > conftest.c </dev/null` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null \ - | grep " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | sed 's/.* -> //'` - case "$potliblink" in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ - | sed 10q \ - | egrep "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - echo "*** Warning: This library needs some functionality provided by $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | - grep . >/dev/null; then - echo - if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - echo "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - # Get the real and link names of the library. - eval library_names=\"$library_names_spec\" - set dummy $library_names - realname="$2" - shift; shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - lib="$output_objdir/$realname" - for link - do - linknames="$linknames $link" - done - - # Ensure that we have .o objects for linkers which dislike .lo - # (e.g. aix) incase we are running --disable-static - for obj in $libobjs; do - oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"` - if test ! -f $oldobj; then - $show "${LN_S} $obj $oldobj" - $run ${LN_S} $obj $oldobj || exit $? - fi - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - eval cmds=\"$export_symbols_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - if test -n "$export_symbols_regex"; then - $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" - $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - $show "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "mkdir $gentop" - $run mkdir "$gentop" - status=$? - if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - for xlib in $convenience; do - # Extract the objects. - case "$xlib" in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - - libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` - done - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linkopts="$linkopts $flag" - fi - - # Do each of the archive commands. - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval cmds=\"$archive_expsym_cmds\" - else - eval cmds=\"$archive_cmds\" - fi - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - *.lo | *.o | *.obj) - if test -n "$link_against_libtool_libs"; then - $echo "$modename: error: cannot link libtool libraries into objects" 1>&2 - exit 1 - fi - - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 - fi - - case "$output" in - *.lo) - if test -n "$objs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit 1 - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $run $rm $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${obj}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "mkdir $gentop" - $run mkdir "$gentop" - status=$? - if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - for xlib in $convenience; do - # Extract the objects. - case "$xlib" in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - - reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` - done - fi - fi - - # Create the old-style object. - reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" - - output="$obj" - eval cmds=\"$reload_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit 0 - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - $show "echo timestamp > $libobj" - $run eval "echo timestamp > $libobj" || exit $? - exit 0 - fi - - if test -n "$pic_flag"; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - eval cmds=\"$reload_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - else - # Just create a symlink. - $show $rm $libobj - $run $rm $libobj - $show "$LN_S $obj $libobj" - $run $LN_S $obj $libobj || exit $? - fi - - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit 0 - ;; - - # Anything else should be a program. - *) - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 - fi - - if test "$preload" = yes; then - if test "$dlopen" = unknown && test "$dlopen_self" = unknown && - test "$dlopen_self_static" = unknown; then - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi - fi - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$compile_rpath " in - *" $libdir "*) ;; - *) compile_rpath="$compile_rpath $libdir" ;; - esac - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - - # Create the binary in the object directory, then wrap it. - if test ! -d $output_objdir; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test $status -ne 0 && test ! -d $output_objdir; then - exit $status - fi - fi - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - dlsyms="${outputname}S.c" - else - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 - fi - fi - - if test -n "$dlsyms"; then - case "$dlsyms" in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${outputname}.nm" - - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - - # Parse the name list into a source file. - $show "creating $output_objdir/$dlsyms" - - test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* Prevent the only kind of declaration conflicts we can make. */ -#define lt_preloaded_symbols some_other_symbol - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - $show "generating symbol list for \`$output'" - - test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - if test -n "$export_symbols_regex"; then - $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$output.exp" - $run $rm $export_symbols - $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - else - $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' - $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - fi - fi - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" - name=`echo "$arg" | sed -e 's%^.*/%%'` - $run eval 'echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -z "$run"; then - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $mv "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then - : - else - grep -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' - else - echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ - -#undef lt_preloaded_symbols - -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{\ -" - - sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \ - -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \ - < "$nlist" >> "$output_objdir/$dlsyms" - - $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr_t) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - fi - - pic_flag_for_symtable= - case "$host" in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; - esac - esac - - # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" - $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" - - # Transform the symbol file into the correct name. - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit 1 - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` - fi - - if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - $show "$link_command" - $run eval "$link_command" - status=$? - - # Delete the generated files. - if test -n "$dlsyms"; then - $show "$rm $output_objdir/${outputname}S.${objext}" - $run $rm "$output_objdir/${outputname}S.${objext}" - fi - - exit $status - fi - - if test -n "$shlibpath_var"; then - # We should set the shlibpath_var - rpath= - for dir in $temp_rpath; do - case "$dir" in - [\\/]* | [A-Za-z]:[\\/]*) - # Absolute path. - rpath="$rpath$dir:" - ;; - *) - # Relative path: add a thisdir entry. - rpath="$rpath\$thisdir/$dir:" - ;; - esac - done - temp_rpath="$rpath" - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 - $echo "$modename: \`$output' will be relinked during installation" 1>&2 - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname - - $show "$link_command" - $run eval "$link_command" || exit $? - - # Now create the wrapper script. - $show "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $echo for shipping. - if test "X$echo" = "X$SHELL $0 --fallback-echo"; then - case "$0" in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; - *) qecho="$SHELL `pwd`/$0 --fallback-echo";; - esac - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if our run command is non-null. - if test -z "$run"; then - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) output=`echo $output|sed 's,.exe$,,'` ;; - esac - $rm $output - trap "$rm $output; exit 1" 1 2 15 - - $echo > $output "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -sed_quote_subst='$sed_quote_subst' - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variable: - link_against_libtool_libs='$link_against_libtool_libs' -else - # When we are sourced in execute mode, \$file and \$echo are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - echo=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$echo works! - : - else - # Restart under the correct shell, and then maybe \$echo will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $echo >> $output "\ - - # Find the directory that this script lives in. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - echo >> $output "\ - program=lt-'$outputname' - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || \\ - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $mkdir \"\$progdir\" - else - $rm \"\$progdir/\$file\" - fi" - - echo >> $output "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if (cd \"\$thisdir\" && eval \$relink_command); then : - else - $rm \"\$progdir/\$file\" - exit 1 - fi - fi - - $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $rm \"\$progdir/\$program\"; - $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $rm \"\$progdir/\$file\" - fi" - else - echo >> $output "\ - program='$outputname$exeext' - progdir=\"\$thisdir/$objdir\" -" - fi - - echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $echo >> $output "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $echo >> $output "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - *-*-cygwin* | *-*-mingw | *-*-os2*) - # win32 systems need to use the prog path for dll - # lookup to work - $echo >> $output "\ - exec \$progdir\\\\\$program \${1+\"\$@\"} -" - ;; - *) - $echo >> $output "\ - # Export the path to the program. - PATH=\"\$progdir:\$PATH\" - export PATH - - exec \$program \${1+\"\$@\"} -" - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" - exit 1 - fi - else - # The program doesn't exist. - \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 - \$echo \"This script is just a wrapper for \$program.\" 1>&2 - echo \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" - chmod +x $output - fi - exit 0 - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "mkdir $gentop" - $run mkdir "$gentop" - status=$? - if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - # Add in members from convenience archives. - for xlib in $addlibs; do - # Extract the objects. - case "$xlib" in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - - oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` - done - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - eval cmds=\"$old_archive_from_new_cmds\" - else - # Ensure that we have .o objects in place incase we decided - # not to build a shared library, and have fallen back to building - # static libs even though --disable-static was passed! - for oldobj in $oldobjs; do - if test ! -f $oldobj; then - obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"` - $show "${LN_S} $obj $oldobj" - $run ${LN_S} $obj $oldobj || exit $? - fi - done - - eval cmds=\"$old_archive_cmds\" - fi - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$generated"; then - $show "${rm}r$generated" - $run ${rm}r$generated - fi - - # Now create the libtool archive. - case "$output" in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - $show "creating $output" - - if test -n "$xrpath"; then - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - done - dependency_libs="$temp_xrpath $dependency_libs" - fi - - # Only create the output if not a dry run. - if test -z "$run"; then - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - fi - $rm $output - $echo > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$dlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Directory that this library needs to be installed in: -libdir='$install_libdir'\ -" - done - fi - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $? - ;; - esac - exit 0 - ;; - - # libtool install mode - install) - modename="$modename: install" - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$arg " - arg="$1" - shift - else - install_prog= - arg="$nonopt" - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog$arg" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest="$arg" - continue - fi - - case "$arg" in - -d) isdir=yes ;; - -f) prev="-f" ;; - -g) prev="-g" ;; - -m) prev="-m" ;; - -o) prev="-o" ;; - -s) - stripme=" -s" - continue - ;; - -*) ;; - - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest="$arg" - continue - fi - ;; - esac - - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog $arg" - done - - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test -z "$files"; then - if test -z "$dest"; then - $echo "$modename: no file or destination specified" 1>&2 - else - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 - exit 1 - fi - - # Strip any trailing slash from the destination. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` - test "X$destdir" = "X$dest" && destdir=. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - - # Not a directory, so check to see that there is only one file specified. - set dummy $files - if test $# -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - fi - case "$destdir" in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case "$file" in - *.lo) ;; - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case "$file" in - *.a | *.lib) - # Do the static libraries later. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - library_names= - old_library= - # If there is no directory component, then add one. - case "$file" in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/" - test "X$dir" = "X$file/" && dir= - dir="$dir$objdir" - - # See the names of the shared library. - set dummy $library_names - if test -n "$2"; then - realname="$2" - shift - shift - - # Install the shared library and build the symlinks. - $show "$install_prog $dir/$realname $destdir/$realname" - $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $? - - if test $# -gt 0; then - # Delete the old symlinks, and create new ones. - for linkname - do - if test "$linkname" != "$realname"; then - $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - fi - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - eval cmds=\"$postinstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Install the pseudo-library for information purposes. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case "$destfile" in - *.lo) - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` - ;; - *.o | *.obj) - staticdest="$destfile" - destfile= - ;; - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - esac - - # Install the libtool object if requested. - if test -n "$destfile"; then - $show "$install_prog $file $destfile" - $run eval "$install_prog $file $destfile" || exit $? - fi - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - - $show "$install_prog $staticobj $staticdest" - $run eval "$install_prog \$staticobj \$staticdest" || exit $? - fi - exit 0 - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Do a test to see if this is really a libtool program. - if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - link_against_libtool_libs= - relink_command= - - # If there is no directory component, then add one. - case "$file" in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Check the variables that should have been set. - if test -z "$link_against_libtool_libs"; then - $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 - exit 1 - fi - - finalize=yes - for lib in $link_against_libtool_libs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - # If there is no directory component, then add one. - case "$lib" in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - fi - libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`" - if test -n "$libdir" && test ! -f "$libfile"; then - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 - finalize=no - fi - done - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes && test -z "$run"; then - tmpdir="/tmp" - test -n "$TMPDIR" && tmpdir="$TMPDIR" - tmpdir="$tmpdir/libtool-$$" - if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : - else - $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 - continue - fi - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - ${rm}r "$tmpdir" - continue - fi - file="$outputname" - else - $echo "$modename: warning: cannot relink \`$file'" 1>&2 - fi - else - # Install the binary that we compiled earlier. - file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - $show "$install_prog$stripme $file $destfile" - $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && ${rm}r "$tmpdir" - ;; - esac - done - - for file in $staticlibs; do - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - - # Do each command in the postinstall commands. - eval cmds=\"$old_postinstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$future_libdirs"; then - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 - fi - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" - exec $SHELL $0 --finish$current_libdirs - exit 1 - fi - - exit 0 - ;; - - # libtool finish mode - finish) - modename="$modename: finish" - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - eval cmds=\"$finish_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || admincmds="$admincmds - $cmd" - done - IFS="$save_ifs" - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $run eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - test "$show" = : && exit 0 - - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - echo " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use \`-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - echo " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - echo " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - echo - echo "See any operating system documentation about shared libraries for" - echo "more information, such as the ld(1) and ld.so(8) manual pages." - echo "----------------------------------------------------------------------" - exit 0 - ;; - - # libtool execute mode - execute) - modename="$modename: execute" - - # The first argument is the command name. - cmd="$nonopt" - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" - exit 1 - fi - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - dir= - case "$file" in - *.la) - # Check to see that this really is a libtool archive. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Read the libtool library. - dlname= - library_names= - - # If there is no directory component, then add one. - case "$file" in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" - continue - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit 1 - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - ;; - - *) - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case "$file" in - -*) ;; - *) - # Do a test to see if this is really a libtool program. - if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case "$file" in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` - args="$args \"$file\"" - done - - if test -z "$run"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - - # Restore saved enviroment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi - if test "${save_LANG+set}" = set; then - LANG="$save_LANG"; export LANG - fi - - # Now actually exec the command. - eval "exec \$cmd$args" - - $echo "$modename: cannot exec \$cmd$args" - exit 1 - else - # Display what would be done. - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" - $echo "$cmd$args" - exit 0 - fi - ;; - - # libtool uninstall mode - uninstall) - modename="$modename: uninstall" - rm="$nonopt" - files= - - for arg - do - case "$arg" in - -*) rm="$rm $arg" ;; - *) files="$files $arg" ;; - esac - done - - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - for file in $files; do - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - rmfiles="$file" - - case "$name" in - *.la) - # Possibly a libtool archive, so verify it. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $dir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library" - - $show "$rm $rmfiles" - $run $rm $rmfiles - - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - eval cmds=\"$postuninstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" - done - IFS="$save_ifs" - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - eval cmds=\"$old_postuninstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" - done - IFS="$save_ifs" - fi - - # FIXME: should reinstall the best remaining shared library. - fi - ;; - - *.lo) - if test "$build_old_libs" = yes; then - oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` - rmfiles="$rmfiles $dir/$oldobj" - fi - $show "$rm $rmfiles" - $run $rm $rmfiles - ;; - - *) - $show "$rm $rmfiles" - $run $rm $rmfiles - ;; - esac - done - exit 0 - ;; - - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 - exit 1 - ;; - esac - - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit 1 -fi # test -z "$show_help" - -# We need to display help for each of the modes. -case "$mode" in -"") $echo \ -"Usage: $modename [OPTION]... [MODE-ARG]... - -Provide generalized library-building support services. - - --config show all configuration variables - --debug enable verbose shell tracing --n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --finish same as \`--mode=finish' - --help display this help message and exit - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages - --version print version information - -MODE must be one of the following: - - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for -a more detailed description of MODE." - exit 0 - ;; - -compile) - $echo \ -"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -static always build a \`.o' file suitable for static linking - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - -execute) - $echo \ -"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - -finish) - $echo \ -"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - -install) - $echo \ -"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - -link) - $echo \ -"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - -uninstall) - $echo \ -"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - -*) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; -esac - -echo -$echo "Try \`$modename --help' for more information about other modes." - -exit 0 - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/main/Makefile.am b/main/Makefile.am index cbbe0a4b..89b2c939 100644 --- a/main/Makefile.am +++ b/main/Makefile.am @@ -1,9 +1,28 @@ -INCLUDES = -I $(top_srcdir)/includes -fwritable-strings +SUBDIRS = editor old -bin_PROGRAMS = d2x +CFLAGS += -fwritable-strings + +INCLUDES = -I$(top_srcdir)/includes -I$(top_srcdir)/arch/include + +bin_PROGRAMS = @TARGETS@ + +EXTRA_PROGRAMS = d2x d2x-sdl d2x-ogl d2x-svga d2x-ggi + +LDFLAGS = -export-dynamic + +d2x_LDADD = ../3d/lib3d.a ../2d/lib2d.a ../mem/libmem.a ../cfile/libcfile.a ../iff/libiff.a ../texmap/libtexmap.a ../misc/libmisc.a ../maths/libmaths.a ../video/libvideo.a ../arch/libarch.a ../sound/libsound.a ../input/libinput.a + +if MINGW32 +d2x_sdl_LDADD = ${d2x_LDADD} ${SDL_LIBS} +else +d2x_sdl_LDADD = ${d2x_LDADD} -lm -ldl -lpthread ${SDL_LIBS} +endif +d2x_ogl_LDADD = ${d2x_sdl_LDADD} ${OGL_LIBS} +d2x_svga_LDADD = ${d2x_sdl_LDADD} ${SVGA_LIBS} +d2x_ggi_LDADD = ${d2x_sdl_LDADD} ${GGI_LIBS} d2x_SOURCES = \ -ai.c gamerend.c lighting.c paging.c switch.c \ +ai.c gamerend.c lighting.c paging.c switch.c \ ai2.c effects.c gamesave.c menu.c physics.c texmerge.c \ aipath.c endlevel.c gameseg.c mglobal.c piggy.c text.c \ automap.c escort.c gameseq.c mission.c playsave.c titles.c \ @@ -17,16 +36,22 @@ credits.c gamemine.c kmatrix.c newmenu.c songs.c \ crypt.c gamepal.c laser.c object.c state.c \ console.c cmd.c +d2x_sdl_SOURCES = ${d2x_SOURCES} +d2x_ogl_SOURCES = ${d2x_SOURCES} +d2x_svga_SOURCES = ${d2x_SOURCES} +d2x_ggi_SOURCES = ${d2x_SOURCES} -d2x_LDFLAGS = -export-dynamic - -if ENV_DJGPP - d2x_LDADD = ../3d/lib3d.a ../2d/lib2d.a ../mem/libmem.a ../cfile/libcfile.a ../iff/libiff.a ../texmap/libtexmap.a ../misc/libmisc.a ../maths/libmaths.a ../video/libvideo.a ../arch/libarch.a ../sound/libsound.a ../input/libinput.a - -else -if USE_OPENGL - d2x_LDADD = ../3d/lib3d.a ../2d/lib2d.a ../mem/libmem.a ../cfile/libcfile.a ../iff/libiff.a ../texmap/libtexmap.a ../misc/libmisc.a ../maths/libmaths.a ../arch/libarch.a ../video/libvideo.a ../sound/libsound.a ../input/libinput.a -lm -lSDL -ldl -lpthread -lMesaGL -lMesaGLU -lgii -L/usr/X11R6/lib -lXext -else - d2x_LDADD = ../3d/lib3d.a ../2d/lib2d.a ../mem/libmem.a ../cfile/libcfile.a ../iff/libiff.a ../texmap/libtexmap.a ../misc/libmisc.a ../maths/libmaths.a ../arch/libarch.a ../video/libvideo.a ../sound/libsound.a ../input/libinput.a -lm -lSDL -ldl -lpthread -endif -endif +EXTRA_DIST = \ +descent.cfg inferno.ini \ +link.bat \ +ai.h aistruct.h automap.h bm.h bmread.h cdrom.h cntrlcen.h collide.h \ +compbit.h config.h controls.h credits.h desc_id.h desw.h digi.h effects.h \ +endlevel.h fireball.h fuelcen.h fvi.h fvi_a.h game.h gamefont.h gamemine.h \ +gamepal.h gamesave.h gameseg.h gameseq.h gamestat.h gauges.h hostage.h \ +inferno.h joydefs.h kconfig.h kmatrix.h laser.h lighting.h menu.h mission.h \ +modem.h morph.h movie.h multi.h multibot.h netmisc.h network.h newdemo.h \ +newmenu.h object.h paging.h physics.h piggy.h player.h playsave.h polyobj.h \ +powerup.h render.h robot.h scores.h screens.h segment.h segpoint.h slew.h \ +songs.h sounds.h state.h switch.h terrain.h texmerge.h text.h textures.h \ +titles.h vclip.h vers_id.h wall.h weapon.h \ +dumpmine.c diff --git a/main/Makefile.in b/main/Makefile.in deleted file mode 100644 index b9c5bd3a..00000000 --- a/main/Makefile.in +++ /dev/null @@ -1,348 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# 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. - -# 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. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CFLAGS = @CFLAGS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NASM = @NASM@ -NASMFLAGS = @NASMFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -SDL_LIBS = @SDL_LIBS@ -VERSION = @VERSION@ - -INCLUDES = -I $(top_srcdir)/includes -fwritable-strings - -bin_PROGRAMS = d2x - -d2x_SOURCES = ai.c gamerend.c lighting.c paging.c switch.c ai2.c effects.c gamesave.c menu.c physics.c texmerge.c aipath.c endlevel.c gameseg.c mglobal.c piggy.c text.c automap.c escort.c gameseq.c mission.c playsave.c titles.c bm.c fireball.c gauges.c morph.c polyobj.c vclip.c bmread.c fuelcen.c hostage.c multi.c powerup.c wall.c cntrlcen.c fvi.c hud.c multibot.c render.c weapon.c collide.c game.c inferno.c netmisc.c robot.c config.c gamecntl.c kconfig.c network.c scores.c controls.c gamefont.c kludge.c newdemo.c slew.c credits.c gamemine.c kmatrix.c newmenu.c songs.c crypt.c gamepal.c laser.c object.c state.c console.c cmd.c - - -d2x_LDFLAGS = -export-dynamic -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../conf.h -CONFIG_CLEAN_FILES = -PROGRAMS = $(bin_PROGRAMS) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I.. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -d2x_OBJECTS = ai.o gamerend.o lighting.o paging.o switch.o ai2.o \ -effects.o gamesave.o menu.o physics.o texmerge.o aipath.o endlevel.o \ -gameseg.o mglobal.o piggy.o text.o automap.o escort.o gameseq.o \ -mission.o playsave.o titles.o bm.o fireball.o gauges.o morph.o \ -polyobj.o vclip.o bmread.o fuelcen.o hostage.o multi.o powerup.o wall.o \ -cntrlcen.o fvi.o hud.o multibot.o render.o weapon.o collide.o game.o \ -inferno.o netmisc.o robot.o config.o gamecntl.o kconfig.o network.o \ -scores.o controls.o gamefont.o kludge.o newdemo.o slew.o credits.o \ -gamemine.o kmatrix.o newmenu.o songs.o crypt.o gamepal.o laser.o \ -object.o state.o console.o cmd.o -d2x_LDADD = $(LDADD) -d2x_DEPENDENCIES = -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -DEP_FILES = .deps/ai.P .deps/ai2.P .deps/aipath.P .deps/automap.P \ -.deps/bm.P .deps/bmread.P .deps/cmd.P .deps/cntrlcen.P .deps/collide.P \ -.deps/config.P .deps/console.P .deps/controls.P .deps/credits.P \ -.deps/crypt.P .deps/effects.P .deps/endlevel.P .deps/escort.P \ -.deps/fireball.P .deps/fuelcen.P .deps/fvi.P .deps/game.P \ -.deps/gamecntl.P .deps/gamefont.P .deps/gamemine.P .deps/gamepal.P \ -.deps/gamerend.P .deps/gamesave.P .deps/gameseg.P .deps/gameseq.P \ -.deps/gauges.P .deps/hostage.P .deps/hud.P .deps/inferno.P \ -.deps/kconfig.P .deps/kludge.P .deps/kmatrix.P .deps/laser.P \ -.deps/lighting.P .deps/menu.P .deps/mglobal.P .deps/mission.P \ -.deps/morph.P .deps/multi.P .deps/multibot.P .deps/netmisc.P \ -.deps/network.P .deps/newdemo.P .deps/newmenu.P .deps/object.P \ -.deps/paging.P .deps/physics.P .deps/piggy.P .deps/playsave.P \ -.deps/polyobj.P .deps/powerup.P .deps/render.P .deps/robot.P \ -.deps/scores.P .deps/slew.P .deps/songs.P .deps/state.P .deps/switch.P \ -.deps/texmerge.P .deps/text.P .deps/titles.P .deps/vclip.P .deps/wall.P \ -.deps/weapon.P -SOURCES = $(d2x_SOURCES) -OBJECTS = $(d2x_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu main/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -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: - -d2x: $(d2x_OBJECTS) $(d2x_DEPENDENCIES) - @rm -f d2x - $(LINK) $(d2x_LDFLAGS) $(d2x_OBJECTS) $(d2x_LDADD) $(LIBS) - -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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - 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 = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = main - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu main/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - 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 - @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 -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: install-binPROGRAMS -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: uninstall-binPROGRAMS -uninstall: uninstall-am -all-am: Makefile $(PROGRAMS) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - $(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-am - -clean-am: clean-binPROGRAMS clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \ - distclean-depend distclean-generic clean-am - -distclean: distclean-am - -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-am - -.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ -maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags 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 \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -@ENV_DJGPP_TRUE@ d2x_LDADD = ../3d/lib3d.a ../2d/lib2d.a ../mem/libmem.a ../cfile/libcfile.a ../iff/libiff.a ../texmap/libtexmap.a ../misc/libmisc.a ../maths/libmaths.a ../video/libvideo.a ../arch/libarch.a ../sound/libsound.a ../input/libinput.a - -@ENV_DJGPP_FALSE@@USE_OPENGL_TRUE@ d2x_LDADD = ../3d/lib3d.a ../2d/lib2d.a ../mem/libmem.a ../cfile/libcfile.a ../iff/libiff.a ../texmap/libtexmap.a ../misc/libmisc.a ../maths/libmaths.a ../arch/libarch.a ../video/libvideo.a ../sound/libsound.a ../input/libinput.a -lm -lSDL -ldl -lpthread -lMesaGL -lMesaGLU -lgii -L/usr/X11R6/lib -lXext -@ENV_DJGPP_FALSE@@USE_OPENGL_FALSE@ d2x_LDADD = ../3d/lib3d.a ../2d/lib2d.a ../mem/libmem.a ../cfile/libcfile.a ../iff/libiff.a ../texmap/libtexmap.a ../misc/libmisc.a ../maths/libmaths.a ../arch/libarch.a ../video/libvideo.a ../sound/libsound.a ../input/libinput.a -lm -lSDL -ldl -lpthread - -# 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/main/ai.c b/main/ai.c index 2dc8739e..47365a37 100644 --- a/main/ai.c +++ b/main/ai.c @@ -12,9 +12,12 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ -char ai_rcsid[] = "$Id: ai.c,v 1.1.1.1 2001-01-19 03:30:02 bradleyb Exp $"; - +#ifdef HAVE_CONFIG_H #include +#endif + +char ai_rcsid[] = "$Id: ai.c,v 1.2 2001-01-31 15:17:48 bradleyb Exp $"; + #include #include #include diff --git a/main/ai.h b/main/ai.h index 057715ab..4b82901a 100644 --- a/main/ai.h +++ b/main/ai.h @@ -214,9 +214,7 @@ extern ubyte Stolen_items[MAX_STOLEN_ITEMS]; extern fix Escort_last_path_created; extern int Escort_goal_object, Escort_special_goal, Escort_goal_index; -#ifndef NDEBUG extern void create_buddy_bot(void); -#endif extern int Max_escort_length; diff --git a/main/ai2.c b/main/ai2.c index 9f381c84..a55a1bee 100644 --- a/main/ai2.c +++ b/main/ai2.c @@ -11,12 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: ai2.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $"; +static char rcsid[] = "$Id: ai2.c,v 1.2 2001-01-31 15:17:48 bradleyb Exp $"; #endif -#include #include #include #include diff --git a/main/aipath.c b/main/aipath.c index 6aa355aa..957c669a 100644 --- a/main/aipath.c +++ b/main/aipath.c @@ -11,7 +11,10 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H #include +#endif + #include // for printf() #include // for rand() and qsort() #include // for memset() diff --git a/main/automap.c b/main/automap.c index 1142dcb8..8382582e 100644 --- a/main/automap.c +++ b/main/automap.c @@ -11,8 +11,10 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ - +#ifdef HAVE_CONFIG_H #include +#endif + #include #include #include diff --git a/main/bm.c b/main/bm.c index bff5642f..f432b0a1 100644 --- a/main/bm.c +++ b/main/bm.c @@ -11,11 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef RCS -static char rcsid[] = "$Id: bm.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $"; +static char rcsid[] = "$Id: bm.c,v 1.3 2001-01-31 15:17:49 bradleyb Exp $"; #endif -#include #include #include @@ -746,7 +749,7 @@ void bm_read_extra_robots(char *fname,int type) int sig; sig = cfile_read_int(fp); - if (sig != 'XHAM') + if (sig != 0x5848414d) /* 'XHAM' */ return; version = cfile_read_int(fp); } diff --git a/main/bmread.c b/main/bmread.c index 60885268..d3863409 100644 --- a/main/bmread.c +++ b/main/bmread.c @@ -11,13 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -char bmread_rcsid[] = "$Id: bmread.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $"; +char bmread_rcsid[] = "$Id: bmread.c,v 1.2 2001-01-31 15:17:49 bradleyb Exp $"; #endif -#include - #ifdef EDITOR diff --git a/main/cmd.c b/main/cmd.c index ac0e77ef..14f9698e 100644 --- a/main/cmd.c +++ b/main/cmd.c @@ -1,4 +1,7 @@ +#ifdef HAVE_CONFIG_H #include +#endif + #include #include #include diff --git a/main/cntrlcen.c b/main/cntrlcen.c index 09fe806b..73f0512e 100644 --- a/main/cntrlcen.c +++ b/main/cntrlcen.c @@ -11,15 +11,18 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef RCS -static char rcsid[] = "$Id: cntrlcen.c,v 1.1.1.1 2001-01-19 03:29:59 bradleyb Exp $"; +static char rcsid[] = "$Id: cntrlcen.c,v 1.2 2001-01-31 15:17:49 bradleyb Exp $"; #endif #ifdef WINDOWS #include "desw.h" #endif -#include #include #include #include diff --git a/main/collide.c b/main/collide.c index 30cb47b2..1aab1ceb 100644 --- a/main/collide.c +++ b/main/collide.c @@ -11,12 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: collide.c,v 1.1.1.1 2001-01-19 03:30:00 bradleyb Exp $"; +static char rcsid[] = "$Id: collide.c,v 1.4 2001-01-31 15:17:49 bradleyb Exp $"; #endif -#include #include // for memset #include #include @@ -524,6 +526,8 @@ int check_effect_blowup(segment *seg,int side,vms_vector *pnt, object *blower, i { int tm,tmf,ec,db; + db=0; + // If this wall has a trigger and the blower-upper is not the player or the buddy, abort! { int ok_to_blow = 0; @@ -1345,8 +1349,10 @@ void multi_send_finish_game (); // Return 1 if robot died, else return 0 int apply_damage_to_robot(object *robot, fix damage, int killer_objnum) { +#ifdef NETWORK char isthief; char i,temp_stolen[MAX_STOLEN_ITEMS]; +#endif if ( robot->flags&OF_EXPLODING) return 0; diff --git a/main/config.c b/main/config.c index e4c05a41..8da5cfb0 100644 --- a/main/config.c +++ b/main/config.c @@ -11,7 +11,9 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H #include +#endif #ifndef MACINTOSH // I'm going to totally seperate these routines -- yeeech!!!! // see end of file for macintosh equivs @@ -46,7 +48,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #ifdef RCS -static char rcsid[] = "$Id: config.c,v 1.1.1.2 2001-01-19 03:33:47 bradleyb Exp $"; +static char rcsid[] = "$Id: config.c,v 1.4 2001-10-12 00:18:38 bradleyb Exp $"; #endif ubyte Config_digi_volume = 8; @@ -339,7 +341,7 @@ int ReadConfigFile() joy_set_cal_vals(joy_axis_min, joy_axis_center, joy_axis_max); #endif - i = args_find( "-volume" ); + i = FindArg( "-volume" ); if ( i > 0 ) { i = atoi( Args[i+1] ); @@ -369,8 +371,8 @@ int ReadConfigFile() Config_digi_type = digi_driver_board; Config_digi_dma = digi_driver_dma;*/ -#if !defined WINDOWS && !defined __ENV_LINUX__ && !defined __ENV_DJGPP__ - if (digi_driver_board_16 > 0 && !args_find("-no16bit") && digi_driver_board_16 != _GUS_16_ST) { +#if 0 + if (digi_driver_board_16 > 0 && !FindArg("-no16bit") && digi_driver_board_16 != _GUS_16_ST) { digi_driver_board = digi_driver_board_16; digi_driver_dma = digi_driver_dma_16; } @@ -474,7 +476,7 @@ int WriteConfigFile() fputs(str, infile);*/ sprintf (str, "%s=%d\n", midi_volume_str, Config_midi_volume); fputs(str, infile); - sprintf (str, "%s=%d\n", redbook_enabled_str, args_find("-noredbook")?save_redbook_enabled:Redbook_enabled); + sprintf (str, "%s=%d\n", redbook_enabled_str, FindArg("-noredbook")?save_redbook_enabled:Redbook_enabled); fputs(str, infile); sprintf (str, "%s=%d\n", redbook_volume_str, Config_redbook_volume); fputs(str, infile); @@ -576,7 +578,7 @@ int WriteConfigFile() #endif #ifdef RCS -static char rcsid[] = "$Id: config.c,v 1.1.1.2 2001-01-19 03:33:47 bradleyb Exp $"; +static char rcsid[] = "$Id: config.c,v 1.4 2001-10-12 00:18:38 bradleyb Exp $"; #endif #define MAX_CTB_LEN 512 diff --git a/main/console.c b/main/console.c index d92e37ee..6a941a69 100644 --- a/main/console.c +++ b/main/console.c @@ -1,4 +1,7 @@ +#ifdef HAVE_CONFIG_H #include +#endif + #include #include #include @@ -10,7 +13,7 @@ #include "console.h" #include "cmd.h" -#ifdef __ENV_LINUX__ +#if defined(__ENV_LINUX__) || defined(__MINGW32__) int text_console_enabled = 1; #else int isvga(); diff --git a/main/controls.c b/main/controls.c index 535466ec..0765a5c6 100644 --- a/main/controls.c +++ b/main/controls.c @@ -11,12 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: controls.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $"; +static char rcsid[] = "$Id: controls.c,v 1.2 2001-01-31 15:17:49 bradleyb Exp $"; #endif -#include #include #include diff --git a/main/credits.c b/main/credits.c index a9a12c13..5e218b52 100644 --- a/main/credits.c +++ b/main/credits.c @@ -11,16 +11,18 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: credits.c,v 1.1.1.1 2001-01-19 03:30:04 bradleyb Exp $"; +static char rcsid[] = "$Id: credits.c,v 1.3 2001-01-31 15:17:50 bradleyb Exp $"; #endif #ifdef WINDOWS #include "desw.h" #endif -#include #include #include #include @@ -90,6 +92,7 @@ ubyte fade_values_hires[480] = { 1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5, 5,5,4,4,4,4,4,3,3,3,3,3,2,2,2,2,2,1,1}; extern ubyte *gr_bitblt_fade_table; +extern void gr_bm_bitblt(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest); grs_font * header_font; grs_font * title_font; @@ -189,7 +192,9 @@ WIN(int credinit = 0;) WIN(DEFINE_SCREEN(NULL)); +#ifdef WINDOWS CreditsPaint: +#endif gr_use_palette_table( "credits.256" ); #if defined(POLY_ACC) pa_update_clut(gr_palette, 0, 256, 0); diff --git a/main/crypt.c b/main/crypt.c index 0a94416d..7a72842c 100644 --- a/main/crypt.c +++ b/main/crypt.c @@ -11,11 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef RCS -char crypt_rcsid[] = "$Id: crypt.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $"; +char crypt_rcsid[] = "$Id: crypt.c,v 1.2 2001-01-31 15:17:50 bradleyb Exp $"; #endif -#include #include #include #include diff --git a/main/dumpmine.c b/main/dumpmine.c index 7d89be52..2c3fd51a 100644 --- a/main/dumpmine.c +++ b/main/dumpmine.c @@ -11,12 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: dumpmine.c,v 1.1.1.1 2001-01-19 03:30:00 bradleyb Exp $"; +static char rcsid[] = "$Id: dumpmine.c,v 1.2 2001-01-31 15:17:50 bradleyb Exp $"; #endif -#include #include #include #include diff --git a/main/editor/Makefile.am b/main/editor/Makefile.am new file mode 100644 index 00000000..4458e28d --- /dev/null +++ b/main/editor/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ +editor.h kdefs.h texpage.h diff --git a/main/effects.c b/main/effects.c index f4dbd463..6406b458 100644 --- a/main/effects.c +++ b/main/effects.c @@ -11,12 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: effects.c,v 1.1.1.1 2001-01-19 03:30:00 bradleyb Exp $"; +static char rcsid[] = "$Id: effects.c,v 1.2 2001-01-31 15:17:50 bradleyb Exp $"; #endif -#include #include #include #include diff --git a/main/endlevel.c b/main/endlevel.c index 9a15b2b5..d47e9e46 100644 --- a/main/endlevel.c +++ b/main/endlevel.c @@ -11,11 +11,13 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ -#ifdef RCS -static char rcsid[] = "$Id: endlevel.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $"; +#ifdef HAVE_CONFIG_H +#include #endif -#include +#ifdef RCS +static char rcsid[] = "$Id: endlevel.c,v 1.2 2001-01-31 15:17:50 bradleyb Exp $"; +#endif //#define SLEW_ON 1 diff --git a/main/escort.c b/main/escort.c index 9c1fe75b..c856f601 100644 --- a/main/escort.c +++ b/main/escort.c @@ -11,8 +11,10 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ - +#ifdef HAVE_CONFIG_H #include +#endif + #include // for printf() #include // for rand() and qsort() #include // for memset() diff --git a/main/fireball.c b/main/fireball.c index 9ee26483..fe95467a 100644 --- a/main/fireball.c +++ b/main/fireball.c @@ -11,8 +11,10 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ - +#ifdef HAVE_CONFIG_H #include +#endif + #include #include #include diff --git a/main/fuelcen.c b/main/fuelcen.c index 0cb64ca0..20318ef9 100644 --- a/main/fuelcen.c +++ b/main/fuelcen.c @@ -11,12 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: fuelcen.c,v 1.1.1.1 2001-01-19 03:29:59 bradleyb Exp $"; +static char rcsid[] = "$Id: fuelcen.c,v 1.2 2001-01-31 15:17:50 bradleyb Exp $"; #endif -#include #include #include #include diff --git a/main/fuelcen.h b/main/fuelcen.h index d9fa8a3d..7b8bc8b2 100644 --- a/main/fuelcen.h +++ b/main/fuelcen.h @@ -131,4 +131,6 @@ extern void init_all_matcens(void); extern fix EnergyToCreateOneRobot; +void fuelcen_check_for_hoard_goal(segment *segp); + #endif diff --git a/main/fvi.c b/main/fvi.c index c76e766f..71f1ad43 100644 --- a/main/fvi.c +++ b/main/fvi.c @@ -14,8 +14,10 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ - +#ifdef HAVE_CONFIG_H #include +#endif + #include #include #include diff --git a/main/game.c b/main/game.c index d434c91a..998c4a86 100644 --- a/main/game.c +++ b/main/game.c @@ -11,15 +11,18 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef RCS -char game_rcsid[] = "$Id: game.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $"; +char game_rcsid[] = "$Id: game.c,v 1.7 2001-01-31 16:31:13 bradleyb Exp $"; #endif #ifdef WINDOWS #include "desw.h" #endif -#include #include #include #include @@ -35,6 +38,10 @@ char game_rcsid[] = "$Id: game.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $"; #include #endif +#ifdef OGL +#include "ogl_init.h" +#endif + #include "pstypes.h" #include "console.h" #include "pa_enabl.h" //$$POLY_ACC @@ -107,6 +114,7 @@ char game_rcsid[] = "$Id: game.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $"; #include "robot.h" #include "playsave.h" #include "fix.h" +#include "d_delay.h" int VGA_current_mode; @@ -1147,6 +1155,8 @@ int Movie_fixed_frametime; #define Movie_fixed_frametime 0 #endif +static const int max_fps = 80; + void calc_frame_time() { fix timer_value,last_frametime = FrameTime; @@ -1158,18 +1168,14 @@ void calc_frame_time() timer_value = timer_get_fixed_seconds(); FrameTime = timer_value - last_timer_value; - #ifndef RELEASE - if (Saving_movie_frames || Movie_fixed_frametime) { - if (FrameTime > f1_0/15) - mprintf((0,"slow frame: %x\n",FrameTime)); - else - do { - timer_value = timer_get_fixed_seconds(); - FrameTime = timer_value - last_timer_value; - } while (FrameTime < f1_0/15); - FrameTime = f1_0/15; - } - #endif + do { + timer_value = timer_get_fixed_seconds(); + FrameTime = timer_value - last_timer_value; + if (FrameTime < f1_0/max_fps); + { + d_delay(1); + } + } while (FrameTime < f1_0/max_fps); #if defined(TIMER_TEST) && !defined(NDEBUG) _timer_value = timer_value; @@ -1403,6 +1409,8 @@ void save_screen_shot(int automap_flag) int modex_flag; int stereo=0; + temp_canv2=NULL; + // // Can't do screen shots in VR modes. // if ( VR_render_mode != VR_NONE ) // return; @@ -2591,7 +2599,7 @@ void GameLoop(int RenderFlag, int ReadControlsFlag ) #endif #ifndef RELEASE - if (args_find("-invulnerability")) + if (FindArg("-invulnerability")) Players[Player_num].flags |= PLAYER_FLAGS_INVULNERABLE; #endif @@ -2698,7 +2706,7 @@ void GameLoop(int RenderFlag, int ReadControlsFlag ) } #ifndef NDEBUG - if (args_find("-checktime") != 0) + if (FindArg("-checktime") != 0) if (GameTime >= i2f(600)) //wrap after 10 minutes GameTime = FrameTime; #endif diff --git a/main/gamecntl.c b/main/gamecntl.c index 60a28c28..ec837e95 100644 --- a/main/gamecntl.c +++ b/main/gamecntl.c @@ -13,8 +13,10 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ - +#ifdef HAVE_CONFIG_H #include +#endif + #include #include #include @@ -115,6 +117,9 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #endif +#ifdef SDL_INPUT +#include +#endif extern void full_palette_save(void); extern void object_goto_prev_viewer(void); @@ -429,6 +434,8 @@ int do_game_pause() char msg[1000]; char total_time[9],level_time[9]; + key=0; + if (Game_paused) { //unpause! Game_paused=0; #if defined (TACTILE) @@ -489,6 +496,12 @@ int do_game_pause() show_boxed_message(Pause_msg=msg); //TXT_PAUSE); gr_update(); +#ifdef SDL_INPUT + /* give control back to the WM */ + if (FindArg("-grabmouse")) + SDL_WM_GrabInput(SDL_GRAB_OFF); +#endif + while (Game_paused) { int screen_changed; @@ -548,6 +561,12 @@ int do_game_pause() } } +#ifdef SDL_INPUT + /* keep the mouse from wandering in SDL/X11 */ + if (FindArg("-grabmouse")) + SDL_WM_GrabInput(SDL_GRAB_ON); +#endif + if (VR_screen_flags & VRF_COMPATIBLE_MENUS) { clear_boxed_message(); } @@ -620,7 +639,7 @@ void do_show_netgame_help() for (i=0;i +#endif #ifdef RCS -static char rcsid[] = "$Id: gamefont.c,v 1.1.1.1 2001-01-19 03:30:04 bradleyb Exp $"; +static char rcsid[] = "$Id: gamefont.c,v 1.2 2001-01-31 15:17:52 bradleyb Exp $"; #endif -#include #include #include "inferno.h" diff --git a/main/gamemine.c b/main/gamemine.c index 5f05d7b6..7800f096 100644 --- a/main/gamemine.c +++ b/main/gamemine.c @@ -11,11 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef RCS -static char rcsid[] = "$Id: gamemine.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $"; +static char rcsid[] = "$Id: gamemine.c,v 1.2 2001-01-31 15:17:52 bradleyb Exp $"; #endif -#include #include #include #include diff --git a/main/gamepal.c b/main/gamepal.c index e5bdd691..88b855a4 100644 --- a/main/gamepal.c +++ b/main/gamepal.c @@ -11,8 +11,10 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ - +#ifdef HAVE_CONFIG_H #include +#endif + #include #include #include @@ -37,6 +39,8 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "poly_acc.h" #endif +extern void g3_remap_interp_colors(); + char Current_level_palette[FILENAME_LEN]; extern int Color_0_31_0, HUD_color; diff --git a/main/gamerend.c b/main/gamerend.c index 54d47a7a..8fea3546 100644 --- a/main/gamerend.c +++ b/main/gamerend.c @@ -11,13 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: gamerend.c,v 1.1.1.2 2001-01-19 03:33:47 bradleyb Exp $"; +static char rcsid[] = "$Id: gamerend.c,v 1.5 2001-10-12 00:18:38 bradleyb Exp $"; #endif - -#include #ifdef WINDOWS #include "desw.h" #include "winapp.h" @@ -63,6 +64,10 @@ static char rcsid[] = "$Id: gamerend.c,v 1.1.1.2 2001-01-19 03:33:47 bradleyb Ex #include "poly_acc.h" #endif +#ifdef OGL +#include "ogl_init.h" +#endif + extern fix Cruise_speed; extern int LinearSVGABuffer; extern int Current_display_mode; @@ -423,7 +428,7 @@ extern int gr_bitblt_dest_step_shift; extern int gr_wait_for_retrace; extern int gr_bitblt_double; -#if !defined MACINTOSH && !defined __ENV_LINUX__ && !defined __ENV_DJGPP__ +#if 0 void expand_row(ubyte * dest, ubyte * src, int num_src_pixels ); #pragma aux expand_row parm [edi] [esi] [ecx] modify exact [ecx esi edi eax ebx] = \ "add esi, ecx" \ @@ -1444,6 +1449,7 @@ void toggle_cockpit() case CM_REAR_VIEW: case CM_LETTERBOX: + default: return; //do nothing break; diff --git a/main/gamesave.c b/main/gamesave.c index 691d6c17..2d45459a 100644 --- a/main/gamesave.c +++ b/main/gamesave.c @@ -11,11 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef RCS -char gamesave_rcsid[] = "$Id: gamesave.c,v 1.1.1.1 2001-01-19 03:29:59 bradleyb Exp $"; +char gamesave_rcsid[] = "$Id: gamesave.c,v 1.4 2001-01-31 15:17:53 bradleyb Exp $"; #endif -#include #include #include @@ -1243,6 +1246,8 @@ int load_game_data(CFILE *LoadFile) v30_trigger trig; int t,type; + type=0; + if (game_top_fileinfo.fileinfo_version < 30) { v29_trigger trig29; int t; @@ -1645,7 +1650,10 @@ int load_level(char * filename_passed) CFILE * LoadFile; char filename[128]; int version,minedata_offset,gamedata_offset; - int mine_err,game_err,i; + int mine_err,game_err; +#ifdef NETWORK + int i; +#endif char sig[4]; Slide_segs_computed = 0; diff --git a/main/gameseg.c b/main/gameseg.c index 47c3ea79..1bdcd23e 100644 --- a/main/gameseg.c +++ b/main/gameseg.c @@ -11,8 +11,10 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ - +#ifdef HAVE_CONFIG_H #include +#endif + #include #include #include // for memset() @@ -31,7 +33,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "byteswap.h" #ifdef RCS -static char rcsid[] = "$Id: gameseg.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $"; +static char rcsid[] = "$Id: gameseg.c,v 1.3 2001-01-31 15:17:53 bradleyb Exp $"; #endif // How far a point can be from a plane, and still be "in" the plane @@ -1864,7 +1866,7 @@ int set_segment_depths(int start_seg, ubyte *segbuf) int queue[MAX_SEGMENTS]; int head, tail; int depth; - int parent_depth; + int parent_depth=0; depth = 1; head = 0; diff --git a/main/gameseq.c b/main/gameseq.c index f093ae8d..7a5b8c1d 100644 --- a/main/gameseq.c +++ b/main/gameseq.c @@ -11,12 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -char gameseq_rcsid[] = "$Id: gameseq.c,v 1.1.1.1 2001-01-19 03:30:05 bradleyb Exp $"; +char gameseq_rcsid[] = "$Id: gameseq.c,v 1.4 2001-01-31 15:17:53 bradleyb Exp $"; #endif -#include #ifdef WINDOWS #include "desw.h" #endif @@ -561,8 +563,6 @@ void editor_reset_stuff_on_level() } #endif -void reset_player_object(); - //do whatever needs to be done when a player dies in multiplayer void DoGameOver() @@ -1630,7 +1630,9 @@ int Secret_level_table[MAX_SECRET_LEVELS_PER_MISSION]; // Return true if game over. void AdvanceLevel(int secret_flag) { +#ifdef NETWORK int result; +#endif mprintf((0,"AdvanceLevel\n")); @@ -2086,7 +2088,9 @@ extern char PowerupsInMine[MAX_POWERUP_TYPES], MaxPowerupsAllowed[MAX_POWERUP_TY #endif void bash_to_shield (int i,char *s) { +#ifdef NETWORK int type=Objects[i].id; +#endif mprintf((0, "Bashing %s object #%i to shield.\n",s, i)); @@ -2240,7 +2244,7 @@ void StartNewLevel(int level_num, int secret_flag) //initialize the player object position & orientation (at start of game, or new ship) void InitPlayerPosition(int random_flag) { - int NewPlayer; + int NewPlayer=0; #ifdef NETWORK if (! ((Game_mode & GM_MULTI) && !(Game_mode&GM_MULTI_COOP)) ) // If not deathmatch @@ -2304,7 +2308,9 @@ void InitPlayerPosition(int random_flag) obj_relink(ConsoleObject-Objects,Player_init[NewPlayer].segnum); +#ifdef NETWORK done: +#endif reset_player_object(); reset_cruise(); } diff --git a/main/gauges.c b/main/gauges.c index 7610c96b..b4160b10 100644 --- a/main/gauges.c +++ b/main/gauges.c @@ -983,9 +983,11 @@ void hud_show_score() void hud_show_timer_count() { +#ifdef NETWORK char score_str[20]; int w, h, aw,i; fix timevar=0; +#endif if ((HUD_nmessages > 0) && (strlen(HUD_messages[hud_first]) > 38)) return; @@ -1322,6 +1324,8 @@ void hud_show_orbs (void) int x,y; grs_bitmap *bm; + x=y=0; + if (Cockpit_mode == CM_FULL_COCKPIT) { y = 2*Line_spacing; x = 4*GAME_FONT->ft_w; @@ -1353,6 +1357,8 @@ void hud_show_flag(void) if ((Game_mode & GM_CAPTURE) && (Players[Player_num].flags & PLAYER_FLAGS_FLAG)) { int x,y,icon; + x=y=0; + if (Cockpit_mode == CM_FULL_COCKPIT) { y = 2*Line_spacing; x = 4*GAME_FONT->ft_w; @@ -2138,7 +2144,7 @@ void draw_player_ship(int cloak_state,int old_cloak_state,int x, int y) static fix cloak_fade_timer=0; static int cloak_fade_value=GR_FADE_LEVELS-1; static int refade = 0; - grs_bitmap *bm; + grs_bitmap *bm = NULL; if (Game_mode & GM_TEAM) { #ifdef NETWORK @@ -3598,6 +3604,8 @@ void do_cockpit_window_view(int win,object *viewer,int rear_view_flag,int user,c int rear_view_save = Rear_view; int w,h,dx; + box = NULL; + if (viewer == NULL) { //this user is done Assert(user == WBU_WEAPON || user == WBU_STATIC); diff --git a/main/hostage.c b/main/hostage.c index 307add92..e2c66b5f 100644 --- a/main/hostage.c +++ b/main/hostage.c @@ -11,11 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef RCS -static char rcsid[] = "$Id: hostage.c,v 1.1.1.1 2001-01-19 03:29:59 bradleyb Exp $"; +static char rcsid[] = "$Id: hostage.c,v 1.2 2001-01-31 15:17:53 bradleyb Exp $"; #endif -#include #include #include #include diff --git a/main/hud.c b/main/hud.c index 2e24d18b..0874dec6 100644 --- a/main/hud.c +++ b/main/hud.c @@ -349,11 +349,11 @@ int HUD_init_message(char * format, ... ) // Added by Leighton - if ((Game_mode & GM_MULTI) && args_find("-noredundancy")) + if ((Game_mode & GM_MULTI) && FindArg("-noredundancy")) if (!strnicmp ("You already",message,11)) return 0; - if ((Game_mode & GM_MULTI) && args_find("-PlayerMessages") && PlayerMessage==0) + if ((Game_mode & GM_MULTI) && FindArg("-PlayerMessages") && PlayerMessage==0) return 0; if (HUD_nmessages > 0) { diff --git a/main/inferno.c b/main/inferno.c index 1639aa6c..3c5c752f 100644 --- a/main/inferno.c +++ b/main/inferno.c @@ -86,6 +86,10 @@ extern int Current_display_mode; //$$ there's got to be a better way than #include "ui.h" #endif +#ifdef SDL_INPUT +#include +#endif + #include "vers_id.h" void mem_init(void); @@ -141,22 +145,168 @@ int grd_fades_disabled=1; #define LINE_LEN 100 +//read help from a file & print to screen +void print_commandline_help() +{ + CFILE *ifile; + int have_binary=0; + char line[LINE_LEN]; + + ifile = cfopen("help.tex","rb"); + if (!ifile) { + ifile = cfopen("help.txb","rb"); + if (!ifile) + Error("Cannot load help text file."); + have_binary = 1; + } + + while (cfgets(line,LINE_LEN,ifile)) { + + if (have_binary) { + int i; + for (i = 0; i < strlen(line) - 1; i++) { + encode_rotate_left(&(line[i])); + line[i] = line[i] ^ BITMAP_TBL_XOR; + encode_rotate_left(&(line[i])); + } + } + +// if (line[0] == ';') +// continue; //don't show comments + + printf("%s",line); + + } + + cfclose(ifile); + +// D2X-specific options: + printf( " D2X Options:\n\n"); + printf( " -noredundancy %s\n", "Do not send messages when picking up redundant items in multi"); + printf( " -shortpackets %s\n", "Set shortpackets to default as on"); + printf( " -notitles %s\n", "Do not show titlescreens on startup"); + printf( " -ini %s\n", "option file (alternate to command line)"); + printf( " -autodemo %s\n","FIXME: Undocumented"); + printf( " -autoload %s\n","FIXME: Undocumented"); + printf( " -bigpig %s\n","FIXME: Undocumented"); + printf( " -bspgen %s\n","FIXME: Undocumented"); + printf( " -cdproxy %s\n","FIXME: Undocumented"); + printf( " -checktime %s\n","FIXME: Undocumented"); + printf( " -codereadonly %s\n","FIXME: Undocumented"); + printf( " -cyberimpact %s\n","FIXME: Undocumented"); + printf( " -ddemul %s\n","FIXME: Undocumented"); + printf( " -debug %s\n","FIXME: Undocumented"); + printf( " -debugmode %s\n","FIXME: Undocumented"); + printf( " -disallowgfx %s\n","FIXME: Undocumented"); + printf( " -disallowreboot %s\n","FIXME: Undocumented"); + printf( " -dynamicsockets %s\n","FIXME: Undocumented"); + printf( " -emul %s\n","FIXME: Undocumented"); + printf( " -forcegfx %s\n","FIXME: Undocumented"); + printf( " -grabmouse %s\n","FIXME: Undocumented"); + printf( " -hoarddata %s\n","FIXME: Undocumented"); + printf( " -hw_3dacc %s\n","FIXME: Undocumented"); + printf( " -hwsurface %s\n","FIXME: Undocumented"); + printf( " -invulnerability %s\n","FIXME: Undocumented"); + printf( " -ipxnetwork %s\n","FIXME: Undocumented"); + printf( " -jasen %s\n","FIXME: Undocumented"); + printf( " -joyslow %s\n","FIXME: Undocumented"); + printf( " -kali %s\n","FIXME: Undocumented"); + printf( " -logfile %s\n","FIXME: Undocumented"); + printf( " -lowresmovies %s\n","FIXME: Undocumented"); + printf( " -macdata %s\n","FIXME: Undocumented"); + printf( " -memdbg %s\n","FIXME: Undocumented"); + printf( " -monodebug %s\n","FIXME: Undocumented"); + printf( " -nobm %s\n","FIXME: Undocumented"); + printf( " -nocdrom %s\n","FIXME: Undocumented"); + printf( " -nocyberman %s\n","FIXME: Undocumented"); + printf( " -nofade %s\n","FIXME: Undocumented"); + printf( " -nomatrixcheat %s\n","FIXME: Undocumented"); + printf( " -nomixer %s\n","FIXME: Undocumented"); + printf( " -nomodex %s\n","FIXME: Undocumented"); + printf( " -nomovies %s\n","FIXME: Undocumented"); + printf( " -norankings %s\n","FIXME: Undocumented"); + printf( " -noredbook %s\n","FIXME: Undocumented"); + printf( " -norun %s\n","FIXME: Undocumented"); + printf( " -noscreens %s\n","FIXME: Undocumented"); + printf( " -ordinaljoy %s\n","FIXME: Undocumented"); + printf( " -packets %s\n","FIXME: Undocumented"); + printf( " -rtscts %s\n","FIXME: Undocumented"); + printf( " -semiwin %s\n","FIXME: Undocumented"); + printf( " -showaddress %s\n","FIXME: Undocumented"); + printf( " -showmeminfo %s\n","FIXME: Undocumented"); + printf( " -socket %s\n","FIXME: Undocumented"); + printf( " -specialdevice %s\n","FIXME: Undocumented"); + printf( " -stickmag %s\n","FIXME: Undocumented"); + printf( " -stopwatch %s\n","FIXME: Undocumented"); + printf( " -superhires %s\n","FIXME: Undocumented"); + printf( " -sysram %s\n","FIXME: Undocumented"); + printf( " -text %s\n","FIXME: Undocumented"); + printf( " -tsengdebug1 %s\n","FIXME: Undocumented"); + printf( " -tsengdebug2 %s\n","FIXME: Undocumented"); + printf( " -tsengdebug3 %s\n","FIXME: Undocumented"); + printf( " -udp %s\n","FIXME: Undocumented"); + printf( " -vidram %s\n","FIXME: Undocumented"); + printf( " -xcontrol %s\n","FIXME: Undocumented"); + printf( " -xname %s\n","FIXME: Undocumented"); + printf( " -xver %s\n","FIXME: Undocumented"); + + printf( "\n D2X System Options:\n\n"); + +#ifdef __MSDOS__ + printf( " -joy209 %s\n", "Use alternate port 209 for joystick"); +#endif +#ifdef GR_SUPPORTS_FULLSCREEN_TOGGLE + printf( " -fullscreen %s\n", "Use fullscreen mode if available"); +#endif +#ifdef OGL + printf( " -gl_texmagfilt %s\n","set GL_TEXTURE_MAG_FILTER (see readme.d1x)"); + printf( " -gl_texminfilt %s\n","set GL_TEXTURE_MIN_FILTER (see readme.d1x)"); + printf( " -gl_mipmap %s\n","set gl texture filters to \"standard\" options for mipmapping"); + printf( " -gl_simple %s\n","set gl texture filters to gl_nearest for \"original\" look. (default)"); + printf( " -gl_alttexmerge %s\n","use new texmerge, usually uses less ram (default)"); + printf( " -gl_stdtexmerge %s\n","use old texmerge, uses more ram, but _might_ be a bit faster"); + printf( " -gl_voodoo %s\n","force fullscreen mode only"); + printf( " -gl_16bittextures %s\n","attempt to use 16bit textures"); + printf( " -gl_reticle %s\n","use OGL reticle 0=never 1=above 320x* 2=always"); + printf( " -gl_intensity4_ok %s\n","FIXME: Undocumented"); + printf( " -gl_luminance4_alpha4_ok %s\n","FIXME: Undocumented"); + printf( " -gl_readpixels_ok %s\n","FIXME: Undocumented"); + printf( " -gl_rgba2_ok %s\n","FIXME: Undocumented"); + printf( " -gl_test1 %s\n","FIXME: Undocumented"); + printf( " -gl_test2 %s\n","FIXME: Undocumented"); + printf( " -gl_vidmem %s\n","FIXME: Undocumented"); +#ifdef OGL_RUNTIME_LOAD + printf( " -gl_library %s\n","use alternate opengl library"); +#endif +#endif +#ifdef SDL_VIDEO + printf( " -nosdlvidmodecheck %s\n", "Some X servers don't like checking vidmode first, so just switch"); +#endif +#ifdef __ENV_LINUX__ + printf( " -serialdevice %s\n", "Set serial/modem device to "); + printf( " -serialread %s\n", "Set serial/modem to read from "); +#endif + printf( "Help:\n"); + printf( " -help, -?, ? %s\n", "View this help screen"); + printf( "\n"); +} + void do_joystick_init() { - if (!args_find( "-nojoystick" )) { + if (!FindArg( "-nojoystick" )) { con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_6); joy_init(); - if ( args_find( "-joyslow" )) { + if ( FindArg( "-joyslow" )) { con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_7); joy_set_slow_reading(JOY_SLOW_READINGS); } - if ( args_find( "-joypolled" )) { + if ( FindArg( "-joypolled" )) { con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_8); joy_set_slow_reading(JOY_POLLED_READINGS); } - if ( args_find( "-joybios" )) { + if ( FindArg( "-joybios" )) { con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_9); joy_set_slow_reading(JOY_BIOS_READINGS); } @@ -194,14 +344,14 @@ void do_register_player(ubyte *title_pal) #ifdef NETWORK void do_network_init() { - if (!args_find( "-nonetwork" )) { + if (!FindArg( "-nonetwork" )) { int socket=0, showaddress=0, t; int ipx_error; con_printf(CON_VERBOSE, "\n%s ", TXT_INITIALIZING_NETWORK); - if ((t=args_find("-socket"))) + if ((t=FindArg("-socket"))) socket = atoi( Args[t+1] ); - //@@if ( args_find("-showaddress") ) showaddress=1; + //@@if ( FindArg("-showaddress") ) showaddress=1; if ((ipx_error=ipx_init(IPX_DEFAULT_SOCKET+socket,showaddress))==0) { con_printf(CON_VERBOSE, "%s %d.\n", TXT_IPX_CHANNEL, socket ); Network_active = 1; @@ -218,7 +368,7 @@ void do_network_init() } ipx_read_user_file( "descent.usr" ); ipx_read_network_file( "descent.net" ); - //@@if ( args_find( "-dynamicsockets" )) + //@@if ( FindArg( "-dynamicsockets" )) //@@ Network_allow_socket_changes = 1; //@@else //@@ Network_allow_socket_changes = 0; @@ -267,7 +417,6 @@ int main(int argc,char **argv) int i,t; ubyte title_pal[768]; - con_init(); // Initialise the console mem_init(); @@ -275,12 +424,12 @@ int main(int argc,char **argv) args_init( argc,argv ); - if ( args_find( "-debug") ) + if ( FindArg( "-debug") ) { con_threshold.value = (float)2; } else - if ( args_find( "-verbose" ) ) + if ( FindArg( "-verbose" ) ) { con_threshold.value = (float)1; } @@ -312,8 +461,8 @@ int main(int argc,char **argv) con_printf(CON_NORMAL, "This is a MODIFIED version of Descent 2. Copyright (c) 1999 Peter Hawkins\n"); - if (args_find( "-?" ) || args_find( "-help" ) || args_find( "?" ) ) { - //print_commandline_help(); + if (FindArg( "-?" ) || FindArg( "-help" ) || FindArg( "?" ) ) { + print_commandline_help(); set_exit_message(""); return(0); } @@ -324,10 +473,10 @@ int main(int argc,char **argv) con_printf(CON_VERBOSE, "\n%s...", "Checking for Descent 2 CD-ROM"); - if ( args_find( "-autodemo" )) + if ( FindArg( "-autodemo" )) Auto_demo = 1; - if ( args_find( "-noscreens" ) ) + if ( FindArg( "-noscreens" ) ) Skip_briefing_screens = 1; Lighting_on = 1; @@ -360,13 +509,13 @@ int main(int argc,char **argv) set_display_mode(0); //..then set default display mode #endif - i = args_find( "-xcontrol" ); + i = FindArg( "-xcontrol" ); if ( i > 0 ) { kconfig_init_external_controls( strtol(Args[i+1], NULL, 0), strtol(Args[i+2], NULL, 0) ); } con_printf(CON_VERBOSE, "\n%s\n\n", TXT_INITIALIZING_GRAPHICS); - if (args_find("-nofade")) + if (FindArg("-nofade")) grd_fades_disabled=1; if ((t=gr_init())!=0) //doesn't do much @@ -385,7 +534,7 @@ int main(int argc,char **argv) //determine whether we're using high-res menus & movies #if !defined(POLY_ACC) - if (args_find("-nohires") || args_find("-nohighres") || (gr_check_mode(MENU_HIRES_MODE) != 0) || disable_high_res) + if (FindArg("-nohires") || FindArg("-nohighres") || (gr_check_mode(MENU_HIRES_MODE) != 0) || disable_high_res) MovieHires = MenuHires = MenuHiresAvailable = 0; else #endif @@ -403,7 +552,7 @@ int main(int argc,char **argv) #endif #ifndef RELEASE - if ( args_find( "-notitles" ) ) + if ( FindArg( "-notitles" ) ) songs_play_song( SONG_TITLE, 1); else #endif @@ -541,7 +690,7 @@ int main(int argc,char **argv) #endif #ifdef EDITOR - if (args_find("-hoarddata") != 0) { + if (FindArg("-hoarddata") != 0) { #define MAX_BITMAPS_PER_BRUSH 30 grs_bitmap * bm[MAX_BITMAPS_PER_BRUSH]; grs_bitmap icon; @@ -609,7 +758,7 @@ int main(int argc,char **argv) //the bitmap loading code changes gr_palette, so restore it memcpy(gr_palette,title_pal,sizeof(gr_palette)); - if ( args_find( "-norun" ) ) + if ( FindArg( "-norun" ) ) return(0); con_printf( CON_DEBUG, "\nInitializing 3d system..." ); @@ -627,7 +776,7 @@ int main(int argc,char **argv) // to write certain data. #ifdef EDITOR { int t; - if ( t = args_find( "-autoload" ) ) { + if ( t = FindArg( "-autoload" ) ) { Auto_exit = 1; strcpy(Auto_file, Args[t+1]); } @@ -689,7 +838,22 @@ int main(int argc,char **argv) #ifdef EDITOR keyd_editor_mode = 0; #endif + +#ifdef SDL_INPUT + /* keep the mouse from wandering in SDL/X11 */ + if (FindArg("-grabmouse")) + SDL_WM_GrabInput(SDL_GRAB_ON); + +#endif + game(); + +#ifdef SDL_INPUT + /* give control back to the WM */ + if (FindArg("-grabmouse")) + SDL_WM_GrabInput(SDL_GRAB_OFF); +#endif + if ( Function_mode == FMODE_MENU ) songs_play_song( SONG_TITLE, 1 ); break; @@ -712,12 +876,14 @@ int main(int argc,char **argv) WriteConfigFile(); +#if 0 /* ????? */ #ifndef RELEASE - if (!args_find( "-notitles" )) + if (!FindArg( "-notitles" )) #endif +#endif #ifndef NDEBUG - if ( args_find( "-showmeminfo" ) ) + if ( FindArg( "-showmeminfo" ) ) show_mem_info = 1; // Make memory statistics show #endif diff --git a/main/kconfig.c b/main/kconfig.c index 472f668d..b1e213fc 100644 --- a/main/kconfig.c +++ b/main/kconfig.c @@ -11,13 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: kconfig.c,v 1.1.1.2 2001-01-19 03:33:43 bradleyb Exp $"; +static char rcsid[] = "$Id: kconfig.c,v 1.8 2001-10-12 00:18:39 bradleyb Exp $"; #endif -#include - #ifdef WINDOWS #include "desw.h" #endif @@ -67,6 +68,13 @@ static char rcsid[] = "$Id: kconfig.c,v 1.1.1.2 2001-01-19 03:33:43 bradleyb Exp #include "poly_acc.h" #endif +#include "d_delay.h" +#include "collide.h" + +#ifdef __ENV_LINUX__ +#include "linux_joystick.h" +#endif + ubyte ExtGameStatus=1; vms_vector ExtForceVec; @@ -112,7 +120,8 @@ int invert_text[2] = { TNUM_N, TNUM_Y }; TNUM_TRIG, TNUM_LEFT, TNUM_RIGHT, -1, TNUM_UP, TNUM_DOWN, TNUM_LEFT, TNUM_RIGHT }; - int joyaxis_text[4] = { TNUM_X1, TNUM_Y1, TNUM_X2, TNUM_Y2 }; + int joyaxis_text[7] = { TNUM_X1, TNUM_Y1, TNUM_Z1, TNUM_UN, TNUM_P1,TNUM_R1,TNUM_YA1 }; +// int joyaxis_text[4] = { TNUM_X1, TNUM_Y1, TNUM_X2, TNUM_Y2 }; #endif int mouseaxis_text[2] = { TNUM_L_R, TNUM_F_B }; @@ -141,7 +150,7 @@ char * key_text[256] = { "","","","","","","","","","","","","","","","", "","","","","","","","","","","","","","","",""}; #else -#ifndef OGL +#if !defined OGL && !defined SDL_INPUT char * key_text[256] = { \ "","ESC","1","2","3","4","5","6","7","8","9","0","-", \ "=","BSPC","TAB","Q","W","E","R","T","Y","U","I","O", \ @@ -583,6 +592,17 @@ kc_item kc_mouse[NUM_OTHER_CONTROLS] = { #endif +void kc_drawitem( kc_item *item, int is_current ); +void kc_change_key( kc_item * item ); +void kc_change_joybutton( kc_item * item ); +void kc_change_mousebutton( kc_item * item ); +void kc_change_joyaxis( kc_item * item ); +void kc_change_mouseaxis( kc_item * item ); +void kc_change_invert( kc_item * item ); +void kconfig_read_fcs( int raw_axis ); +void kconfig_set_fcs_button( int btn, int button ); +void kconfig_read_external_controls( void ); + int kconfig_is_axes_used(int axis) { int i; @@ -780,7 +800,9 @@ WINDOS( ); save_font = grd_curcanv->cv_font; +#ifdef WINDOWS KConfigPaint: +#endif game_flush_inputs(); old_keyd_repeat = keyd_repeat; keyd_repeat = 1; @@ -950,7 +972,9 @@ WIN(DDGRUNLOCK(dd_grd_curcanv)); kc_drawitem( &items[i], 0 ); } } else { - #ifdef MACINTOSH // hack for firebire and mousestick default controls since I made them the same control type -- dumb dumb dumb + #ifdef MACINTOSH + // hack for firebire and mousestick default controls since I made + // them the same control type -- dumb dumb dumb if (joy_have_firebird()) for (i=0; ivalue==255) { - sprintf( btext, "" ); + strcpy( btext, "" ); } else { switch( item->type ) { case BT_KEY: @@ -1419,7 +1443,7 @@ WIN(DDGRUNLOCK(dd_grd_curcanv)); } } } else { - for (i=0; i<4; i++ ) { + for (i=0; i200 ) { #endif code = i; + printf("Axis Movement detected: Axis %i\n", i); } //old_axis[i] = axis[i]; } for (i=0; i joy_null_value) - raw_joy_axis[i] = ((raw_joy_axis[i]-joy_null_value)*128)/(128-joy_null_value); + raw_joy_axis[i] = ((raw_joy_axis[i]-joy_null_value)*128)/(128-joy_null_value); else if (raw_joy_axis[i] < -joy_null_value) - raw_joy_axis[i] = ((raw_joy_axis[i]+joy_null_value)*128)/(128-joy_null_value); + raw_joy_axis[i] = ((raw_joy_axis[i]+joy_null_value)*128)/(128-joy_null_value); else - raw_joy_axis[i] = 0; + raw_joy_axis[i] = 0; joy_axis[i] = (raw_joy_axis[i]*FrameTime)/128; } +#ifndef __ENV_LINUX__ } else { joy_axis[i] = 0; } +#endif } use_joystick=1; } else { @@ -2713,7 +2754,7 @@ void controls_read_all() joy_axis[i] = 0; use_joystick=0; } -#else +#else // MACINTOSH //--------- Read Joystick ----------- if ((Config_control_type>0) && (Config_control_type<5) ) { channel_masks = joystick_read_raw_axis( JOY_ALL_AXIS, raw_joy_axis ); @@ -2763,7 +2804,7 @@ void controls_read_all() } else if (CybermouseActive) { // ReadOWL (kc_external_control); // CybermouseAdjust(); - } else { + } else { mouse_axis[0] = 0; mouse_axis[1] = 0; mouse_buttons = 0; @@ -3288,8 +3329,8 @@ void controls_read_all() //read_head_tracker(); // Read external controls - if (kc_use_external_control || CybermouseActive) - kconfig_read_external_controls(); + // if (kc_use_external_control || CybermouseActive) + // kconfig_read_external_controls(); #endif //----------- Clamp values between -FrameTime and FrameTime @@ -3427,8 +3468,8 @@ void CybermouseAdjust () char GetKeyValue (char key) { - mprintf ((0,"Returning %c!\n",kc_keyboard[key].value)); - return (kc_keyboard[key].value); + mprintf ((0,"Returning %c!\n",kc_keyboard[(int)key].value)); + return (kc_keyboard[(int)key].value); } #if !defined(MACINTOSH) @@ -3504,7 +3545,7 @@ void kconfig_read_external_controls() kc_external_control->automap_state = 1; //memset(&r,0,sizeof(r)); - #if !defined WINDOWS && !defined __ENV_LINUX__ && !defined __ENV_DJGPP__ + #if 0 int386 ( kc_external_intno, &r, &r); // Read external info... diff --git a/main/kludge.c b/main/kludge.c index d8c4f5fe..f92dc8dc 100644 --- a/main/kludge.c +++ b/main/kludge.c @@ -35,7 +35,7 @@ void gr_copy_palette(ubyte *gr_palette, ubyte *pal, int size) } #ifndef __ENV_DJGPP__ -int joy_set_btn_values( int btn, int state, int time_down, int downcount, int upcount ) +void joy_set_btn_values( int btn, int state, int time_down, int downcount, int upcount ) { } @@ -43,10 +43,10 @@ int joy_set_btn_values( int btn, int state, int time_down, int downcount, int up int request_cd(void) { - + return 0; } -int key_putkey(char i) +void key_putkey(char i) { } @@ -78,7 +78,7 @@ void init_movies() int InitMovieBriefing() { - + return 0; } void RotateRobot() @@ -88,7 +88,7 @@ void RotateRobot() int InitRobotMovie(char *a) { - + return 0; } void DeInitRobotMovie(void) @@ -144,7 +144,7 @@ void network_dump_appletalk_player(ubyte node, ushort net, ubyte socket, int why int digi_link_sound_to_object3( int org_soundnum, short objnum, int forever, fix max_volume, fix max_distance, int loop_start, int loop_end ) { - + return 0; } void digi_stop_sound(int channel) diff --git a/main/kmatrix.c b/main/kmatrix.c index 093c84a4..085ecbe9 100644 --- a/main/kmatrix.c +++ b/main/kmatrix.c @@ -11,13 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: kmatrix.c,v 1.1.1.1 2001-01-19 03:29:59 bradleyb Exp $"; +static char rcsid[] = "$Id: kmatrix.c,v 1.3 2001-01-31 15:17:54 bradleyb Exp $"; #endif -#include - #ifdef NETWORK #ifdef WINDOWS @@ -71,7 +72,10 @@ char WaitingForOthers=0; int Kmatrix_nomovie_message=0; extern char MaxPowerupsAllowed[],PowerupsInMine[]; -extern void network_send_endlevel_sub(int); + +void kmatrix_reactor (char *message); +void kmatrix_phallic (); +void kmatrix_redraw_coop(); #define LHX(x) ((x)*(MenuHires?2:1)) #define LHY(y) ((y)*(MenuHires?2.4:1)) @@ -250,8 +254,8 @@ void kmatrix_draw_deaths(int *sorted) kmatrix_reactor(TXT_REACTOR_EXPLODED); else { - sprintf(&reactor_message, "%s: %d %s ", TXT_TIME_REMAINING, Countdown_seconds_left, TXT_SECONDS); - kmatrix_reactor (&reactor_message); + sprintf((char *)&reactor_message, "%s: %d %s ", TXT_TIME_REMAINING, Countdown_seconds_left, TXT_SECONDS); + kmatrix_reactor ((char *)&reactor_message); } if (Game_mode & GM_HOARD) @@ -320,8 +324,8 @@ void kmatrix_draw_coop_deaths(int *sorted) kmatrix_reactor(TXT_REACTOR_EXPLODED); else { - sprintf(&reactor_message, "%s: %d %s ", TXT_TIME_REMAINING, Countdown_seconds_left, TXT_SECONDS); - kmatrix_reactor (&reactor_message); + sprintf((char *)&reactor_message, "%s: %d %s ", TXT_TIME_REMAINING, Countdown_seconds_left, TXT_SECONDS); + kmatrix_reactor ((char *)&reactor_message); } } @@ -346,7 +350,7 @@ void kmatrix_reactor (char *message) gr_get_string_size(message, &sw, &sh, &aw); gr_printf( CENTERSCREEN-(sw/2), LHY(55+72+12), message); - strcpy (&oldmessage,message); + strcpy ((char *)&oldmessage,message); } extern int PhallicLimit,PhallicMan; diff --git a/main/laser.c b/main/laser.c index 8a277aad..2bdbb18b 100644 --- a/main/laser.c +++ b/main/laser.c @@ -11,13 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -char laser_rcsid[] = "$Id: laser.c,v 1.1.1.1 2001-01-19 03:30:02 bradleyb Exp $"; +char laser_rcsid[] = "$Id: laser.c,v 1.3 2001-01-31 15:17:54 bradleyb Exp $"; #endif -#include - #include #include @@ -71,7 +72,7 @@ extern char BounceCheat; extern void newdemo_record_guided_end(); extern void newdemo_record_guided_start(); - +int find_homing_object(vms_vector *curpos, object *tracker); //--------------------------------------------------------------------------------- // Called by render code.... determines if the laser is from a robot or the @@ -2054,8 +2055,11 @@ void create_smart_children(object *objp, int num_smart_children) } else if (objp->type == OBJ_ROBOT) { parent_type = OBJ_ROBOT; parent_num = objp-Objects; - } else + } else { Int3(); // Hey, what kind of object is this!? + parent_type = 0; + parent_num = 0; + } if (objp->id == EARTHSHAKER_ID) blast_nearby_glass(objp, Weapon_info[EARTHSHAKER_ID].strength[Difficulty_level]); diff --git a/main/lighting.c b/main/lighting.c index 29eb94d2..b787da66 100644 --- a/main/lighting.c +++ b/main/lighting.c @@ -11,12 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: lighting.c,v 1.1.1.1 2001-01-19 03:30:00 bradleyb Exp $"; +static char rcsid[] = "$Id: lighting.c,v 1.3 2001-01-31 15:17:54 bradleyb Exp $"; #endif -#include #include #include // for memset() @@ -76,6 +78,8 @@ Cache_lookups++; fvi_info hit_data; int segnum, hit_type; + segnum = -1; + #ifndef NDEBUG segnum = find_point_seg(obj_pos, obj_seg); if (segnum == -1) { diff --git a/main/menu.c b/main/menu.c index b47f30f7..6ac3a25e 100644 --- a/main/menu.c +++ b/main/menu.c @@ -788,7 +788,7 @@ void set_display_mode(int mode) return; //...don't change #if !defined(MACINTOSH) && !defined(WINDOWS) - if (mode >= 5 && !args_find("-superhires")) + if (mode >= 5 && !FindArg("-superhires")) mode = 4; #endif @@ -897,7 +897,12 @@ void do_screen_res_menu() void do_screen_res_menu() { - #define N_SCREENRES_ITEMS 9 +#ifdef GR_SUPPORTS_FULLSCREEN_TOGGLE +#define N_SCREENRES_ITEMS 10 + int fullscreenc; +#else + #define N_SCREENRES_ITEMS 9 +#endif newmenu_item m[N_SCREENRES_ITEMS]; int citem; int i; @@ -932,13 +937,19 @@ void do_screen_res_menu() m[5].type=NM_TYPE_RADIO; m[5].value=0; m[5].group=0; m[5].text=" 640x480"; m[6].type=NM_TYPE_RADIO; m[6].value=0; m[6].group=0; m[6].text=" 800x600"; n_items = 7; - if (args_find("-superhires")) { + if (FindArg("-superhires")) { m[7].type=NM_TYPE_RADIO; m[7].value=0; m[7].group=0; m[7].text=" 1024x768"; m[8].type=NM_TYPE_RADIO; m[8].value=0; m[8].group=0; m[8].text=" 1280x1024"; n_items += 2; } #endif +#ifdef GR_SUPPORTS_FULLSCREEN_TOGGLE + m[n_items].type = NM_TYPE_CHECK; m[n_items].text = "Fullscreen"; + m[n_items].value = gr_check_fullscreen(); + fullscreenc=n_items++; +#endif + citem = Current_display_mode+1; #ifdef WINDOWS @@ -955,6 +966,12 @@ void do_screen_res_menu() newmenu_do1( NULL, "Select screen mode", n_items, m, NULL, citem); +#ifdef GR_SUPPORTS_FULLSCREEN_TOGGLE + if (m[fullscreenc].value != gr_check_fullscreen()){ + gr_toggle_fullscreen(); + } +#endif + for (i=0;i +#endif + #ifdef RCS -static char rcsid[] = "$Id: mglobal.c,v 1.1.1.1 2001-01-19 03:29:59 bradleyb Exp $"; +static char rcsid[] = "$Id: mglobal.c,v 1.2 2001-01-31 15:17:54 bradleyb Exp $"; #endif -#include #include "fix.h" #include "vecmat.h" #include "inferno.h" diff --git a/main/mission.c b/main/mission.c index fae1d04c..536851c3 100644 --- a/main/mission.c +++ b/main/mission.c @@ -11,13 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: mission.c,v 1.1.1.1 2001-01-19 03:30:05 bradleyb Exp $"; +static char rcsid[] = "$Id: mission.c,v 1.2 2001-01-31 15:17:54 bradleyb Exp $"; #endif -#include - #include #include #include diff --git a/main/morph.c b/main/morph.c index 8edfedfb..b94689ea 100644 --- a/main/morph.c +++ b/main/morph.c @@ -11,13 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: morph.c,v 1.1.1.1 2001-01-19 03:30:02 bradleyb Exp $"; +static char rcsid[] = "$Id: morph.c,v 1.2 2001-01-31 15:17:54 bradleyb Exp $"; #endif -#include - #include #include #include diff --git a/main/multi.c b/main/multi.c index 59777af7..be249600 100644 --- a/main/multi.c +++ b/main/multi.c @@ -99,7 +99,6 @@ void multi_do_play_by_play (char *buf); #define vm_angvec_zero(v) (v)->p=(v)->b=(v)->h=0 -void reset_player_object(void); // In object.c but not in object.h void drop_player_eggs(object *player); // from collide.c void GameLoop(int, int); // From game.c @@ -381,7 +380,8 @@ map_objnum_local_to_local(int local_objnum) void multi_endlevel_score(void) { - int old_connect,i; + int old_connect=0; + int i; // Show a score list to end of net players @@ -942,8 +942,6 @@ multi_send_data(char *buf, int len, int repeat) network_send_data(buf, len, repeat); } -extern void AdjustMineSpawn(); - void multi_leave_game(void) { @@ -1061,7 +1059,7 @@ multi_menu_poll(void) return(-1); } -#if !defined(WINDOWS) && !defined(MACINTOSH) && (!defined(__ENV_LINUX__) && (!defined (__ENV_DJGPP__))) +#if 0 if ((Game_mode & GM_MODEM) && (!GetCd(com_port))) { multi_leave_menu = 1; @@ -4948,7 +4946,7 @@ void multi_add_lifetime_kills () if (oldrank!=GetMyNetRanking()) { multi_send_ranking(); - if (!args_find("-norankings")) + if (!FindArg("-norankings")) { HUD_init_message ("You have been promoted to %s!",RankStrings[GetMyNetRanking()]); digi_play_sample (SOUND_BUDDY_MET_GOAL,F1_0*2); @@ -4977,7 +4975,7 @@ void multi_add_lifetime_killed () multi_send_ranking(); NetPlayers.players[Player_num].rank=GetMyNetRanking(); - if (!args_find("-norankings")) + if (!FindArg("-norankings")) HUD_init_message ("You have been demoted to %s!",RankStrings[GetMyNetRanking()]); } @@ -5009,7 +5007,7 @@ void multi_do_ranking (char *buf) NetPlayers.players[(int)pnum].rank=rank; - if (!args_find("-norankings")) + if (!FindArg("-norankings")) HUD_init_message ("%s has been %s to %s!",Players[(int)pnum].callsign,rankstr,RankStrings[(int)rank]); } void multi_send_modem_ping () diff --git a/main/netmisc.c b/main/netmisc.c index c2d835f6..9440e976 100644 --- a/main/netmisc.c +++ b/main/netmisc.c @@ -11,13 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: netmisc.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $"; +static char rcsid[] = "$Id: netmisc.c,v 1.2 2001-01-31 15:17:54 bradleyb Exp $"; #endif -#include - #include #include diff --git a/main/network.c b/main/network.c index a729f9f1..63b0d482 100644 --- a/main/network.c +++ b/main/network.c @@ -11,11 +11,13 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ -#ifdef RCS -static char rcsid[] = "$Id: network.c,v 1.1.1.2 2001-01-19 03:33:46 bradleyb Exp $"; +#ifdef HAVE_CONFIG_H +#include #endif -#include +#ifdef RCS +static char rcsid[] = "$Id: network.c,v 1.4 2001-01-31 15:17:54 bradleyb Exp $"; +#endif #ifdef NETWORK @@ -72,6 +74,39 @@ static char rcsid[] = "$Id: network.c,v 1.1.1.2 2001-01-19 03:33:46 bradleyb Exp #include "appltalk.h" #endif +void network_send_rejoin_sync(int player_num); +void network_update_netgame(void); +void network_read_endlevel_packet( ubyte *data ); +void network_read_object_packet( ubyte *data ); +void network_read_sync_packet( netgame_info * sp, int d1x ); +void network_flush(); +void network_listen(); +void network_read_pdata_packet(frame_info *pd ); + +void network_check_for_old_version (char pnum); +void network_send_endlevel_short_sub(int from_player_num,int to_player); +int network_wait_for_playerinfo(); +void network_process_pdata (char *data); +void network_read_endlevel_short_packet( ubyte *data ); +void network_ping (ubyte flag,int pnum); +void network_handle_ping_return (ubyte pnum); +void network_process_names_return (char *data); +void network_send_player_names (sequence_packet *their); +int network_choose_connect (); +void network_more_game_options (); +void network_count_powerups_in_mine(void); +int network_wait_for_all_info (int choice); +void network_do_big_wait(int choice); +void network_send_extras (); +void network_read_pdata_short_packet(short_frame_info *pd ); + +void network_AdjustMaxDataSize (); + +void ClipRank (signed char *rank); +void DoRefuseStuff (sequence_packet *their); +void SetAllAllowablesTo (int on); +int GetNewPlayerNumber (sequence_packet *their); + #define LHX(x) ((x)*(MenuHires?2:1)) #define LHY(y) ((y)*(MenuHires?2.4:1)) @@ -375,7 +410,7 @@ network_init(void) Netgame.PacketsPerSec=10; - if ((t=args_find("-packets"))) + if ((t=FindArg("-packets"))) { Netgame.PacketsPerSec=atoi(Args[t+1]); if (Netgame.PacketsPerSec<1) @@ -384,7 +419,7 @@ network_init(void) Netgame.PacketsPerSec=20; mprintf ((0,"Will send %d packets per second",Netgame.PacketsPerSec)); } - if (args_find("-shortpackets")) + if (FindArg("-shortpackets")) { Netgame.ShortPackets=1; mprintf ((0,"Will send short packets.\n")); @@ -782,7 +817,7 @@ network_new_player(sequence_packet *their) ClipRank (&their->player.rank); - if (args_find("-norankings")) + if (FindArg("-norankings")) HUD_init_message("'%s' %s\n",their->player.callsign, TXT_JOINING); else HUD_init_message("%s'%s' %s\n",RankStrings[their->player.rank],their->player.callsign, TXT_JOINING); @@ -808,9 +843,9 @@ void network_welcome_player(sequence_packet *their) WaitForRefuseAnswer=0; - if (args_find("-NoMatrixCheat")) + if (FindArg("-NoMatrixCheat")) { - if (their->player.version_minor & 0x0F<3) + if (their->player.version_minor & (0x0F<3)) { network_dump_player(their->player.network.ipx.server, their->player.network.ipx.node, DUMP_DORK); return; @@ -976,7 +1011,7 @@ void network_welcome_player(sequence_packet *their) digi_play_sample(SOUND_HUD_MESSAGE, F1_0); - if (args_find("-norankings")) + if (FindArg("-norankings")) HUD_init_message("'%s' %s", Players[player_num].callsign, TXT_REJOIN); else HUD_init_message("%s'%s' %s", RankStrings[NetPlayers.players[player_num].rank],Players[player_num].callsign, TXT_REJOIN); @@ -1980,7 +2015,8 @@ void network_send_netgame_update() { // Send game info to someone who requested it - char old_type, old_status,i; + char old_type, old_status; + int i; mprintf((0, "Sending updated game info.\n")); @@ -2204,7 +2240,8 @@ void network_process_dump(sequence_packet *their) { // Our request for join was denied. Tell the user why. - char temp[40],i; + char temp[40]; + int i; mprintf((0, "Dumped by player %s, type %d.\n", their->player.callsign, their->player.connected)); @@ -2882,7 +2919,7 @@ void network_start_poll( int nitems, newmenu_item * menus, int * key, int citem digi_play_sample (SOUND_HUD_MESSAGE,F1_0); mprintf ((0,"More players are printed!")); - if (args_find("-norankings")) + if (FindArg("-norankings")) sprintf( menus[N_players-1].text, "%d. %-20s", N_players,NetPlayers.players[N_players-1].callsign ); else sprintf( menus[N_players-1].text, "%d. %s%-20s", N_players, RankStrings[NetPlayers.players[N_players-1].rank],NetPlayers.players[N_players-1].callsign ); @@ -2902,7 +2939,7 @@ void network_start_poll( int nitems, newmenu_item * menus, int * key, int citem for (i=0; iplayer.rank],their->player.callsign); #ifndef MACINTOSH HUD_init_message ("%s joining. Alt-1 assigns to team %s. Alt-2 to team %s",their->player.callsign,Netgame.team_name[0],Netgame.team_name[1]); @@ -6194,8 +6231,10 @@ int network_choose_connect () #else int network_choose_connect () { +#if 0 newmenu_item m[16]; int choice,opt=0; +#endif if (Network_game_type == IPX_GAME) { #if 0 @@ -6298,8 +6337,8 @@ void ClipRank (signed char *rank) } void network_check_for_old_version (char pnum) { - if (NetPlayers.players[pnum].version_major==1 && (NetPlayers.players[pnum].version_minor & 0x0F)==0) - NetPlayers.players[pnum].rank=0; + if (NetPlayers.players[(int)pnum].version_major==1 && (NetPlayers.players[(int)pnum].version_minor & 0x0F)==0) + NetPlayers.players[(int)pnum].rank=0; } void network_request_player_names (int n) @@ -6339,7 +6378,7 @@ void network_process_names_return (char *data) for (i=0;i<12;i++) { - m[i].text=&mtext[i]; + m[i].text=(char *)&mtext[i]; m[i].type=NM_TYPE_TEXT; } @@ -6370,7 +6409,7 @@ void network_process_names_return (char *data) for (t=0;t +#endif #include #include #include #include // for memset #include +#include /* for isdigit */ #include "u_mem.h" #include "inferno.h" @@ -90,6 +92,10 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. void DoJasonInterpolate (fix recorded_time); +#ifndef __MINGW32__ +void mkdir (char*); /* no idea */ +#endif + //#include "nocfile.h" //Does demo start automatically? @@ -2977,6 +2983,8 @@ void newdemo_stop_recording() char fullname[15+FILENAME_LEN] = DEMO_DIR; unsigned short byte_count = 0; + exit = 0; + nd_write_byte(ND_EVENT_EOF); nd_write_short(frame_bytes_written - 1); if (Game_mode & GM_MULTI) { @@ -3158,7 +3166,7 @@ void newdemo_start_playback(char * filename) if( !FileFindFirst( "demos/*.dem", &find ) ) { do { if ( NumFiles==RandFileNum ) { - filename = &find.name; + filename = (char *)&find.name; break; } NumFiles++; diff --git a/main/newmenu.c b/main/newmenu.c index 50818900..3b6f4253 100644 --- a/main/newmenu.c +++ b/main/newmenu.c @@ -11,13 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: newmenu.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $"; +static char rcsid[] = "$Id: newmenu.c,v 1.3 2001-01-31 15:17:56 bradleyb Exp $"; #endif -#include - #ifdef WINDOWS #include "desw.h" #endif @@ -97,6 +98,10 @@ static char rcsid[] = "$Id: newmenu.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp #define UP_ARROW_MARKER "‡" // 135 #define DOWN_ARROW_MARKER "ˆ" // 136 +int newmenu_do4( char * title, char * subtitle, int nitems, newmenu_item * item, void (*subfunction)(int nitems,newmenu_item * items, int * last_key, int citem), int citem, char * filename, int width, int height, int TinyMode ); +void show_extra_netgame_info(int choice); + + int Newmenu_first_time = 1; //--unused-- int Newmenu_fade_in = 1; @@ -305,6 +310,8 @@ void nm_string( bkg * b, int w1,int x, int y, char * s) char *p,*s1,measure[2]; int XTabs[]={15,87,124,162,228,253}; + p=s1=NULL; + for (i=0;i<6;i++) { XTabs[i]=(LHX(XTabs[i])); @@ -364,6 +371,8 @@ void nm_string_slider( bkg * b, int w1,int x, int y, char * s ) int w,h,aw; char *p,*s1; + s1=NULL; + p = strchr( s, '\t' ); if (p) { *p = '\0'; @@ -764,7 +773,9 @@ int newmenu_do4( char * title, char * subtitle, int nitems, newmenu_item * item, #endif } +#ifdef WINDOWS RePaintNewmenu4: +#endif WINDOS( save_canvas = dd_grd_curcanv, save_canvas = grd_curcanv ); WINDOS( dd_gr_set_current_canvas(NULL), gr_set_current_canvas(NULL) ); @@ -1922,7 +1933,7 @@ int nm_messagebox1( char *title, void (*subfunction)(int nitems,newmenu_item * i nm_message_items[i].type = NM_TYPE_MENU; nm_message_items[i].text = s; } format = va_arg( args, char * ); - sprintf( nm_text, "" ); + strcpy( nm_text, "" ); vsprintf(nm_text,format,args); va_end(args); @@ -1949,7 +1960,7 @@ int nm_messagebox( char *title, int nchoices, ... ) nm_message_items[i].type = NM_TYPE_MENU; nm_message_items[i].text = s; } format = va_arg( args, char * ); - sprintf( nm_text, "" ); + strcpy( nm_text, "" ); vsprintf(nm_text,format,args); va_end(args); @@ -2030,6 +2041,9 @@ int newmenu_get_filename( char * title, char * filespec, char * filename, int al #endif WIN(int win_redraw=0); + w_x=w_y=w_w=w_h=title_height=0; + box_x=box_y=box_w=box_h=0; + filenames = d_malloc( MAX_FILES * 14 ); if (filenames==NULL) return 0; @@ -2101,9 +2115,9 @@ ReadFileNames: // set_screen_mode(SCREEN_MENU); set_popup_screen(); + #ifdef WINDOWS RePaintNewmenuFile: - #ifdef WINDOWS dd_gr_set_current_canvas(NULL); #else gr_set_current_canvas(NULL); @@ -2731,9 +2745,9 @@ WIN(int win_redraw=0); // set_screen_mode(SCREEN_MENU); set_popup_screen(); +#ifdef WINDOWS RePaintNewmenuListbox: -#ifdef WINDOWS dd_gr_set_current_canvas(NULL); #else gr_set_current_canvas(NULL); @@ -3232,7 +3246,7 @@ void show_extra_netgame_info(int choice) for (i=0;i<5;i++) { - m[i].text=&mtext[i]; + m[i].text=(char *)&mtext[i]; m[i].type=NM_TYPE_TEXT; } diff --git a/main/object.c b/main/object.c index c3a7a77e..89e45dd1 100644 --- a/main/object.c +++ b/main/object.c @@ -11,13 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: object.c,v 1.1.1.1 2001-01-19 03:30:00 bradleyb Exp $"; +static char rcsid[] = "$Id: object.c,v 1.5 2001-01-31 15:17:56 bradleyb Exp $"; #endif -#include - #ifdef WINDOWS #include "desw.h" #endif @@ -75,6 +76,7 @@ static char rcsid[] = "$Id: object.c,v 1.1.1.1 2001-01-19 03:30:00 bradleyb Exp #include "text.h" #include "piggy.h" #include "switch.h" +#include "gameseq.h" #ifdef TACTILE #include "tactile.h" @@ -88,6 +90,10 @@ static char rcsid[] = "$Id: object.c,v 1.1.1.1 2001-01-19 03:30:00 bradleyb Exp #include "3dfx_des.h" #endif +void obj_detach_all(object *parent); +void obj_detach_one(object *sub); +int free_object_slots(int num_used); + /* * Global variables */ @@ -335,11 +341,11 @@ extern void draw_tmap_flat(); void draw_cloaked_object(object *obj,fix light,fix *glow,fix cloak_start_time,fix cloak_end_time) { fix cloak_delta_time,total_cloaked_time; - fix light_scale; - int cloak_value; + fix light_scale=F1_0; + int cloak_value=0; int fading=0; //if true, fading, else cloaking - fix Cloak_fadein_duration; - fix Cloak_fadeout_duration; + fix Cloak_fadein_duration=F1_0; + fix Cloak_fadeout_duration=F1_0; total_cloaked_time = cloak_end_time-cloak_start_time; @@ -412,14 +418,26 @@ void draw_cloaked_object(object *obj,fix light,fix *glow,fix cloak_start_time,fi new_light = fixmul(light,light_scale); save_glow = glow[0]; glow[0] = fixmul(glow[0],light_scale); - draw_polygon_model(&obj->pos,&obj->orient,&obj->rtype.pobj_info.anim_angles,obj->rtype.pobj_info.model_num,obj->rtype.pobj_info.subobj_flags,new_light,glow, alt_textures ); + draw_polygon_model(&obj->pos, + &obj->orient, + (vms_angvec *)&obj->rtype.pobj_info.anim_angles, + obj->rtype.pobj_info.model_num,obj->rtype.pobj_info.subobj_flags, + new_light, + glow, + alt_textures ); glow[0] = save_glow; } else { Gr_scanline_darkening_level = cloak_value; gr_setcolor(BM_XRGB(0,0,0)); //set to black (matters for s3) g3_set_special_render(draw_tmap_flat,NULL,NULL); //use special flat drawer - draw_polygon_model(&obj->pos,&obj->orient,&obj->rtype.pobj_info.anim_angles,obj->rtype.pobj_info.model_num,obj->rtype.pobj_info.subobj_flags,light,glow,NULL ); + draw_polygon_model(&obj->pos, + &obj->orient, + (vms_angvec *)&obj->rtype.pobj_info.anim_angles, + obj->rtype.pobj_info.model_num,obj->rtype.pobj_info.subobj_flags, + light, + glow, + NULL ); g3_set_special_render(NULL,NULL,NULL); Gr_scanline_darkening_level = GR_FADE_LEVELS; } @@ -484,7 +502,9 @@ void draw_polygon_object(object *obj) } if (obj->rtype.pobj_info.tmap_override != -1) { +#ifndef NDEBUG polymodel *pm = &Polygon_models[obj->rtype.pobj_info.model_num]; +#endif bitmap_index bm_ptrs[12]; int i; @@ -494,7 +514,14 @@ void draw_polygon_object(object *obj) for (i=0;i<12;i++) //fill whole array, in case simple model needs more bm_ptrs[i] = Textures[obj->rtype.pobj_info.tmap_override]; - draw_polygon_model(&obj->pos,&obj->orient,&obj->rtype.pobj_info.anim_angles,obj->rtype.pobj_info.model_num,obj->rtype.pobj_info.subobj_flags,light,engine_glow_value,bm_ptrs); + draw_polygon_model(&obj->pos, + &obj->orient, + (vms_angvec *)&obj->rtype.pobj_info.anim_angles, + obj->rtype.pobj_info.model_num, + obj->rtype.pobj_info.subobj_flags, + light, + engine_glow_value, + bm_ptrs); } else { @@ -519,11 +546,24 @@ void draw_polygon_object(object *obj) light = 2*light + F1_0; } - draw_polygon_model(&obj->pos,&obj->orient,&obj->rtype.pobj_info.anim_angles,obj->rtype.pobj_info.model_num,obj->rtype.pobj_info.subobj_flags,light,engine_glow_value,alt_textures); + draw_polygon_model(&obj->pos, + &obj->orient, + (vms_angvec *)&obj->rtype.pobj_info.anim_angles,obj->rtype.pobj_info.model_num, + obj->rtype.pobj_info.subobj_flags, + light, + engine_glow_value, + alt_textures); if (obj->type == OBJ_WEAPON && (Weapon_info[obj->id].model_num_inner > -1 )) { fix dist_to_eye = vm_vec_dist_quick(&Viewer->pos, &obj->pos); if (dist_to_eye < Simple_model_threshhold_scale * F1_0*2) - draw_polygon_model(&obj->pos,&obj->orient,&obj->rtype.pobj_info.anim_angles,Weapon_info[obj->id].model_num_inner,obj->rtype.pobj_info.subobj_flags,light,engine_glow_value,alt_textures); + draw_polygon_model(&obj->pos, + &obj->orient, + (vms_angvec *)&obj->rtype.pobj_info.anim_angles, + Weapon_info[obj->id].model_num_inner, + obj->rtype.pobj_info.subobj_flags, + light, + engine_glow_value, + alt_textures); } } } @@ -1822,6 +1862,7 @@ void obj_relink(int objnum,int newsegnum) } //process a continuously-spinning object +void spin_object(object *obj) { vms_angvec rotangs; @@ -1951,7 +1992,11 @@ void object_move_one( object * obj ) default: +#ifdef __ENV_DJGPP__ + Error("Unknown control type %d in object %li, sig/type/id = %i/%i/%i",obj->control_type, obj-Objects, obj->signature, obj->type, obj->id); +#else Error("Unknown control type %d in object %i, sig/type/id = %i/%i/%i",obj->control_type, obj-Objects, obj->signature, obj->type, obj->id); +#endif break; @@ -2236,6 +2281,7 @@ int update_object_seg(object * obj ) //go through all objects and make sure they have the correct segment numbers +void fix_object_segs() { int i; diff --git a/main/object.h b/main/object.h index a61fbc40..f216b41a 100644 --- a/main/object.h +++ b/main/object.h @@ -382,7 +382,7 @@ extern int find_object_seg(object * obj ); //go through all objects and make sure they have the correct segment numbers //used when debugging is on -int fix_object_segs(); +void fix_object_segs(); // Drops objects contained in objp. int object_create_egg(object *objp); @@ -430,4 +430,8 @@ int drop_marker_object(vms_vector *pos,int segnum,vms_matrix *orient,int marker_ extern void wake_up_rendered_objects(object *gmissp, int window_num); +extern void AdjustMineSpawn(); + +void reset_player_object(void); + #endif diff --git a/main/old/Makefile.am b/main/old/Makefile.am new file mode 100644 index 00000000..f1b7b89a --- /dev/null +++ b/main/old/Makefile.am @@ -0,0 +1,5 @@ +EXTRA_DIST = \ +3dfx_des.h arcade.h coindev.h files.h iglasses.h settings.h \ +3dfx.c cdmix32.c cdrom.c coindev.c descentw.c digiobj.c iglasses.c \ +joydefs.c joydefsw.c modem.c movie.c newmodel.c rbtest.c terrain.c \ +windigi.c winferno.c winmodem.c winvideo.c diff --git a/main/paging.c b/main/paging.c index 8ad7bf84..328293f1 100644 --- a/main/paging.c +++ b/main/paging.c @@ -13,13 +13,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: paging.c,v 1.1.1.1 2001-01-19 03:29:59 bradleyb Exp $"; +static char rcsid[] = "$Id: paging.c,v 1.2 2001-01-31 15:17:57 bradleyb Exp $"; #endif -#include - #ifdef WINDOWS #include "desw.h" #endif diff --git a/main/physics.c b/main/physics.c index 0cd8b217..9d6cda3a 100644 --- a/main/physics.c +++ b/main/physics.c @@ -11,11 +11,13 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ -#ifdef RCS -static char rcsid[] = "$Id: physics.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $"; +#ifdef HAVE_CONFIG_H +#include #endif -#include +#ifdef RCS +static char rcsid[] = "$Id: physics.c,v 1.3 2001-01-31 15:17:57 bradleyb Exp $"; +#endif #include #include @@ -101,7 +103,7 @@ void do_physics_align_object( object * obj ) fix d,largest_d=-f1_0; int i,best_side; - + best_side=0; // bank player according to segment orientation //find side of segment that player is most alligned with diff --git a/main/piggy.c b/main/piggy.c index ee81e0b5..41fef2d0 100644 --- a/main/piggy.c +++ b/main/piggy.c @@ -11,12 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: piggy.c,v 1.1.1.1 2001-01-19 03:30:02 bradleyb Exp $"; +static char rcsid[] = "$Id: piggy.c,v 1.4 2001-01-31 15:17:57 bradleyb Exp $"; #endif -#include #include #include @@ -181,7 +183,7 @@ bitmap_index piggy_register_bitmap( grs_bitmap * bmp, char * name, int in_file ) if (!in_file) { #ifdef EDITOR - if ( args_find("-macdata") ) + if ( FindArg("-macdata") ) swap_0_255( bmp ); #endif if ( !BigPig ) gr_bitmap_rle_compress( bmp ); @@ -851,7 +853,7 @@ void piggy_new_pigfile(char *pigname) bm[fnum]->avg_color = compute_average_pixel(bm[fnum]); #ifdef EDITOR - if ( args_find("-macdata") ) + if ( FindArg("-macdata") ) swap_0_255( bm[fnum] ); #endif if ( !BigPig ) gr_bitmap_rle_compress( bm[fnum] ); @@ -904,7 +906,7 @@ void piggy_new_pigfile(char *pigname) new->avg_color = compute_average_pixel(new); #ifdef EDITOR - if ( args_find("-macdata") ) + if ( FindArg("-macdata") ) swap_0_255( new ); #endif if ( !BigPig ) gr_bitmap_rle_compress( new ); @@ -1131,13 +1133,13 @@ int piggy_init(void) GameBitmapOffset[0] = 0; } - if ( args_find( "-bigpig" )) + if ( FindArg( "-bigpig" )) BigPig = 1; - if ( args_find( "-lowmem" )) + if ( FindArg( "-lowmem" )) piggy_low_memory = 1; - if ( args_find( "-nolowmem" )) + if ( FindArg( "-nolowmem" )) piggy_low_memory = 0; if (piggy_low_memory) @@ -1252,6 +1254,8 @@ void piggy_bitmap_page_in( bitmap_index bitmap ) grs_bitmap * bmp; int i,org_i,temp; + org_i = 0; + i = bitmap.index; Assert( i >= 0 ); Assert( i < MAX_BITMAP_FILES ); diff --git a/main/playsave.c b/main/playsave.c index 0cf329c1..5712d77c 100644 --- a/main/playsave.c +++ b/main/playsave.c @@ -435,8 +435,9 @@ int read_player_file() //read taunt macros { - int i,len; #ifdef NETWORK + int i,len; + len = MAX_MESSAGE_LEN; for (i = 0; i < 4; i++) diff --git a/main/polyobj.c b/main/polyobj.c index 808fbad4..c83aaeb0 100644 --- a/main/polyobj.c +++ b/main/polyobj.c @@ -11,13 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: polyobj.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $"; +static char rcsid[] = "$Id: polyobj.c,v 1.5 2001-01-31 15:34:40 bradleyb Exp $"; #endif -#include - #include #include #include @@ -154,12 +155,12 @@ void pof_read_vecs(vms_vector *vecs,int n,ubyte *bufp) Int3(); } -#define ID_OHDR 'RDHO' //Object header -#define ID_SOBJ 'JBOS' //Subobject header -#define ID_GUNS 'SNUG' //List of guns on this object -#define ID_ANIM 'MINA' //Animation data -#define ID_IDTA 'ATDI' //Interpreter data -#define ID_TXTR 'RTXT' //Texture filename list +#define ID_OHDR 0x5244484f // 'RDHO' //Object header +#define ID_SOBJ 0x4a424f53 // 'JBOS' //Subobject header +#define ID_GUNS 0x534e5547 // 'SNUG' //List of guns on this object +#define ID_ANIM 0x4d494e41 // 'MINA' //Animation data +#define ID_IDTA 0x41544449 // 'ATDI' //Interpreter data +#define ID_TXTR 0x52545854 // 'RTXT' //Texture filename list #ifdef DRIVE #define robot_info void @@ -195,7 +196,7 @@ polymodel *read_model_file(polymodel *pm,char *filename,robot_info *r) id = pof_read_int(model_buf); - if (id!='OPSP') + if (id!=0x4f505350) /* 'OPSP' */ Error("Bad ID in model file <%s>",filename); version = pof_read_short(model_buf); @@ -203,7 +204,7 @@ polymodel *read_model_file(polymodel *pm,char *filename,robot_info *r) if (version < PM_COMPATIBLE_VERSION || version > PM_OBJFILE_VERSION) Error("Bad version (%d) in model file <%s>",version,filename); - if ( args_find( "-bspgen" )) + if ( FindArg( "-bspgen" )) printf( "bspgen -c1" ); while (new_pof_read_int(id,model_buf) == 1) { @@ -227,7 +228,7 @@ polymodel *read_model_file(polymodel *pm,char *filename,robot_info *r) pof_read_vecs(&pmmin,1,model_buf); pof_read_vecs(&pmmax,1,model_buf); - if ( args_find( "-bspgen" )) { + if ( FindArg( "-bspgen" )) { vms_vector v; fix l; @@ -372,7 +373,7 @@ polymodel *read_model_file(polymodel *pm,char *filename,robot_info *r) // for (i=0;in_models;i++) // pm->submodel_ptrs[i] += (int) pm->model_data; - if ( args_find( "-bspgen" )) { + if ( FindArg( "-bspgen" )) { char *p = strchr( filename, '.' ); *p = 0; @@ -413,7 +414,7 @@ int read_model_guns(char *filename,vms_vector *gun_points, vms_vector *gun_dirs, id = pof_read_int(model_buf); - if (id!='OPSP') + if (id!=0x4f505350) /* 'OPSP' */ Error("Bad ID in model file <%s>",filename); version = pof_read_short(model_buf); diff --git a/main/powerup.c b/main/powerup.c index 97efa5c3..03a2b5d9 100644 --- a/main/powerup.c +++ b/main/powerup.c @@ -11,8 +11,9 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ - +#ifdef HAVE_CONFIG_H #include +#endif #include #include diff --git a/main/render.c b/main/render.c index 9d45a685..4aed06f0 100644 --- a/main/render.c +++ b/main/render.c @@ -11,11 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef RCS -static char rcsid[] = "$Id: render.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $"; +static char rcsid[] = "$Id: render.c,v 1.4 2001-01-31 15:17:57 bradleyb Exp $"; #endif -#include #include #include #include @@ -626,7 +629,11 @@ im_so_ashamed: ; } } else +#ifdef __ENV_DJGPP__ + Error("Illegal side type in render_side, type = %i, segment # = %li, side # = %i\n", sidep->type, segp-Segments, sidenum); +#else Error("Illegal side type in render_side, type = %i, segment # = %i, side # = %i\n", sidep->type, segp-Segments, sidenum); +#endif } } @@ -1959,7 +1966,9 @@ done_list: //renders onto current canvas void render_mine(int start_seg_num,fix eye_offset, int window_num) { +#ifndef NDEBUG int i; +#endif int nn; // Initialize number of objects (actually, robots!) rendered this frame. diff --git a/main/robot.c b/main/robot.c index f6c8b4cb..8c662f62 100644 --- a/main/robot.c +++ b/main/robot.c @@ -11,8 +11,9 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ - +#ifdef HAVE_CONFIG_H #include +#endif #include diff --git a/main/slew.c b/main/slew.c index bf725165..d69965d5 100644 --- a/main/slew.c +++ b/main/slew.c @@ -11,11 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef RCS -static char rcsid[] = "$Id: slew.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $"; +static char rcsid[] = "$Id: slew.c,v 1.3 2001-01-31 15:17:57 bradleyb Exp $"; #endif -#include #include #include "inferno.h" @@ -89,7 +92,7 @@ int do_slew_movement(object *obj, int check_keys, int check_joy ) if (check_keys) { if (Function_mode == FMODE_EDITOR) { - if (args_find("-jasen")) + if (FindArg("-jasen")) obj->mtype.phys_info.velocity.x += VEL_SPEED * (key_down_time(KEY_PAD3) - key_down_time(KEY_PAD1)); else obj->mtype.phys_info.velocity.x += VEL_SPEED * (key_down_time(KEY_PAD9) - key_down_time(KEY_PAD7)); @@ -97,7 +100,7 @@ int do_slew_movement(object *obj, int check_keys, int check_joy ) obj->mtype.phys_info.velocity.z += VEL_SPEED * (key_down_time(KEY_PAD8) - key_down_time(KEY_PAD2)); rotang.p = (key_down_time(KEY_LBRACKET) - key_down_time(KEY_RBRACKET))/ROT_SPEED ; - if (args_find("-jasen")) + if (FindArg("-jasen")) rotang.b = (key_down_time(KEY_PAD7) - key_down_time(KEY_PAD9))/ROT_SPEED; else rotang.b = (key_down_time(KEY_PAD1) - key_down_time(KEY_PAD3))/ROT_SPEED; diff --git a/main/songs.c b/main/songs.c index 28842511..0e700acf 100644 --- a/main/songs.c +++ b/main/songs.c @@ -11,8 +11,9 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ - +#ifdef HAVE_CONFIG_H #include +#endif #include #include @@ -77,7 +78,7 @@ void songs_init() #if !defined(MACINTOSH) && !defined(WINDOWS) // don't crank it if on a macintosh!!!!! - if (!args_find("-nomixer")) + if (!FindArg("-nomixer")) CD_blast_mixer(); // Crank it! #endif @@ -114,7 +115,7 @@ void songs_init() // RBA Hook #if !defined(SHAREWARE) || ( defined(SHAREWARE) && defined(APPLE_DEMO) ) - if (args_find("-noredbook")) + if (FindArg("-noredbook")) { Redbook_enabled = 0; } @@ -201,7 +202,7 @@ int play_redbook_track(int tracknum,int keep_playing) { Redbook_playing = 0; - if (!RBAEnabled() && Redbook_enabled && !args_find("-noredbook")) + if (!RBAEnabled() && Redbook_enabled && !FindArg("-noredbook")) reinit_redbook(); if (force_rb_register) { @@ -302,7 +303,7 @@ void songs_play_level_song( int levelnum ) songnum = (levelnum>0)?(levelnum-1):(-levelnum); - if (!RBAEnabled() && Redbook_enabled && !args_find("-noredbook")) + if (!RBAEnabled() && Redbook_enabled && !FindArg("-noredbook")) reinit_redbook(); if (force_rb_register) { diff --git a/main/state.c b/main/state.c index d8eaaa60..d17d26dc 100644 --- a/main/state.c +++ b/main/state.c @@ -13,7 +13,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #ifdef RCS -char state_rcsid[] = "$Id: state.c,v 1.1.1.1 2001-01-19 03:30:00 bradleyb Exp $"; +char state_rcsid[] = "$Id: state.c,v 1.3 2001-01-31 14:04:45 bradleyb Exp $"; #endif #include @@ -78,6 +78,7 @@ char state_rcsid[] = "$Id: state.c,v 1.1.1.1 2001-01-19 03:30:00 bradleyb Exp $" #include "controls.h" #include "laser.h" #include "multibot.h" +#include "state.h" #if defined(POLY_ACC) #include "poly_acc.h" @@ -148,6 +149,7 @@ extern byte robot_fire_buf[MAX_ROBOTS_CONTROLLED][18+3]; extern ubyte Hack_DblClick_MenuMode; #endif +void compute_all_static_light(void); //------------------------------------------------------------------- void state_callback(int nitems,newmenu_item * items, int * last_key, int citem) @@ -422,7 +424,7 @@ int copy_file(char *old_file, char *new_file) fwrite(buf, 1, bytes_read, out_file); if (ferror(out_file)) - Error("Cannot write to file <%s>: %s", out_file, strerror(errno)); + Error("Cannot write to file <%s>: %s", new_file, strerror(errno)); } if (fclose(in_file)) { @@ -1006,7 +1008,6 @@ int state_restore_all(int in_game, int secret_restore, char *filename_override) return state_restore_all_sub(filename, 0, secret_restore); } -extern void reset_player_object(void); extern void init_player_stats_new_ship(void); void ShowLevelIntro(int level_num); @@ -1017,7 +1018,7 @@ extern void copy_defaults_to_robot(object *objp); int state_restore_all_sub(char *filename, int multi, int secret_restore) { int ObjectStartLocation; - int version,i, j, segnum,found; + int version,i, j, segnum; object * obj; FILE *fp; int current_level, next_level; @@ -1026,8 +1027,11 @@ int state_restore_all_sub(char *filename, int multi, int secret_restore) char desc[DESC_LENGTH+1]; char id[5]; char org_callsign[CALLSIGN_LEN+16]; +#ifdef NETWORK + int found; int nplayers; //,playid[12],mynum; player restore_players[MAX_PLAYERS]; +#endif fix old_gametime = GameTime; #if defined(MACINTOSH) && !defined(NDEBUG) @@ -1355,14 +1359,14 @@ int state_restore_all_sub(char *filename, int multi, int secret_restore) MarkerObject[num] = -1; } - if (version>=11) + if (version>=11) { if (secret_restore != 1) fread (&Afterburner_charge,sizeof(fix),1,fp); else { fix dummy_fix; fread (&dummy_fix,sizeof(fix),1,fp); } - + } if (version>=12) { //read last was super information fread(&Primary_last_was_super,sizeof(Primary_last_was_super),1,fp); diff --git a/main/switch.c b/main/switch.c index 79d4a517..18647a24 100644 --- a/main/switch.c +++ b/main/switch.c @@ -11,13 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: switch.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $"; +static char rcsid[] = "$Id: switch.c,v 1.3 2001-01-31 15:17:57 bradleyb Exp $"; #endif -#include - #include #include #include @@ -246,6 +247,10 @@ int do_change_walls(byte trigger_num) case TT_OPEN_WALL: new_wall_type = WALL_OPEN; break; case TT_CLOSE_WALL: new_wall_type = WALL_CLOSED; break; case TT_ILLUSORY_WALL: new_wall_type = WALL_ILLUSION; break; + default: + Assert(0); /* new_wall_type unset */ + return(0); + break; } if (Walls[segp->sides[side].wall_num].type == new_wall_type && Walls[csegp->sides[cside].wall_num].type == new_wall_type) diff --git a/main/test.txt b/main/test.txt deleted file mode 100644 index 48be2699..00000000 --- a/main/test.txt +++ /dev/null @@ -1 +0,0 @@ -kconfig.c diff --git a/main/texmerge.c b/main/texmerge.c index 1a99cd01..17a2be53 100644 --- a/main/texmerge.c +++ b/main/texmerge.c @@ -11,7 +11,9 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H #include +#endif #include diff --git a/main/text.c b/main/text.c index 8aac4069..aac91b5f 100644 --- a/main/text.c +++ b/main/text.c @@ -11,13 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: text.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $"; +static char rcsid[] = "$Id: text.c,v 1.3 2001-01-31 15:17:59 bradleyb Exp $"; #endif -#include - #include #include #include @@ -74,7 +75,7 @@ void load_text() char *tptr; char *filename="descent.tex"; - if ((i=args_find("-text"))!=0) + if ((i=FindArg("-text"))!=0) filename = Args[i+1]; if ((tfile = cfopen(filename,"rb")) == NULL) { diff --git a/main/titles.c b/main/titles.c index 780bed29..66edeabe 100644 --- a/main/titles.c +++ b/main/titles.c @@ -11,7 +11,9 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H #include +#endif #ifdef WINDOWS #include "desw.h" @@ -272,9 +274,9 @@ byte Door_dir=1, Door_div_count=0, Animating_bitmap_type=0; void show_bitmap_frame(void) { #ifdef WINDOWS - dd_grs_canvas *curcanv_save, *bitmap_canv; + dd_grs_canvas *curcanv_save, *bitmap_canv=0; #else - grs_canvas *curcanv_save, *bitmap_canv; + grs_canvas *curcanv_save, *bitmap_canv=0; #endif grs_bitmap *bitmap_ptr; diff --git a/main/vclip.c b/main/vclip.c index c80ea53d..2e96b691 100644 --- a/main/vclip.c +++ b/main/vclip.c @@ -11,13 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: vclip.c,v 1.1.1.1 2001-01-19 03:29:59 bradleyb Exp $"; +static char rcsid[] = "$Id: vclip.c,v 1.2 2001-01-31 15:17:59 bradleyb Exp $"; #endif -#include - #include #include "error.h" diff --git a/main/vers_id.h b/main/vers_id.h index 3deb3776..be410049 100644 --- a/main/vers_id.h +++ b/main/vers_id.h @@ -5,4 +5,4 @@ #define VERSION_TYPE "Full Version" - +#define DESCENT_VERSION "D2X " VERSION diff --git a/main/wall.c b/main/wall.c index 103b1611..64814aee 100644 --- a/main/wall.c +++ b/main/wall.c @@ -11,13 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: wall.c,v 1.1.1.1 2001-01-19 03:30:00 bradleyb Exp $"; +static char rcsid[] = "$Id: wall.c,v 1.3 2001-01-31 15:17:59 bradleyb Exp $"; #endif -#include - #include #include #include @@ -595,8 +596,10 @@ void start_wall_decloak(segment *seg, int side) d->time = 0; if (Num_cloaking_walls >= MAX_CLOAKING_WALLS) { //no more! Int3(); //ran out of cloaking wall slots + /* what is this _doing_ here? w->type = WALL_CLOSED; Walls[csegp->sides[Connectside].wall_num].type = WALL_CLOSED; + */ return; } Num_cloaking_walls++; diff --git a/main/weapon.c b/main/weapon.c index f612334d..ee5e7892 100644 --- a/main/weapon.c +++ b/main/weapon.c @@ -11,13 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: weapon.c,v 1.1.1.1 2001-01-19 03:29:59 bradleyb Exp $"; +static char rcsid[] = "$Id: weapon.c,v 1.2 2001-01-31 15:17:59 bradleyb Exp $"; #endif -#include - #include #include #include diff --git a/maths/Makefile.am b/maths/Makefile.am index 5c82f5eb..983e2f0b 100644 --- a/maths/Makefile.am +++ b/maths/Makefile.am @@ -1,14 +1,20 @@ noinst_LIBRARIES = libmaths.a INCLUDES = -I $(top_srcdir)/includes +if USE_ASM +libmaths_a_SOURCES = vecmat.c rand.c tables.c +else libmaths_a_SOURCES = vecmat.c rand.c tables.c fixc.c +endif -if USE_ASM - SUFFIXES = .asm - %.o: %.asm +SUFFIXES = .asm +%.o: %.asm $(NASM) $(NASMFLAGS) $< -o $@ - libmaths_a_SOURCE += vecmata.asm fix.asm - libmaths_a_LIBADD += vecmata.o fix.o - vecmat.c rand.c tables.c: fix.o vecmata.o +if USE_ASM +libmaths_a_LIBADD += vecmata.o fix.o endif + +EXTRA_DIST = \ +fix.asm vecmata.asm \ +fixc.c rand.c tables.c vecmat.c diff --git a/maths/Makefile.in b/maths/Makefile.in deleted file mode 100644 index 0675eff2..00000000 --- a/maths/Makefile.in +++ /dev/null @@ -1,307 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# 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. - -# 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. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CFLAGS = @CFLAGS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NASM = @NASM@ -NASMFLAGS = @NASMFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -SDL_LIBS = @SDL_LIBS@ -VERSION = @VERSION@ - -noinst_LIBRARIES = libmaths.a -INCLUDES = -I $(top_srcdir)/includes - -libmaths_a_SOURCES = vecmat.c rand.c tables.c fixc.c -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../conf.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I.. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -libmaths_a_LIBADD = -libmaths_a_OBJECTS = vecmat.o rand.o tables.o fixc.o -AR = ar -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -DEP_FILES = .deps/fixc.P .deps/rand.P .deps/tables.P .deps/vecmat.P -SOURCES = $(libmaths_a_SOURCES) -OBJECTS = $(libmaths_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu maths/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -.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: - -libmaths.a: $(libmaths_a_OBJECTS) $(libmaths_a_DEPENDENCIES) - -rm -f libmaths.a - $(AR) cru libmaths.a $(libmaths_a_OBJECTS) $(libmaths_a_LIBADD) - $(RANLIB) libmaths.a - -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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - 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 = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = maths - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu maths/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - 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 - @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 -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -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-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-depend mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - 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-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags 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 \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -@USE_ASM_TRUE@ SUFFIXES = .asm -@USE_ASM_TRUE@ %.o: %.asm -@USE_ASM_TRUE@ $(NASM) $(NASMFLAGS) $< -o $@ - -@USE_ASM_TRUE@ libmaths_a_SOURCE += vecmata.asm fix.asm -@USE_ASM_TRUE@ libmaths_a_LIBADD += vecmata.o fix.o -@USE_ASM_TRUE@ vecmat.c rand.c tables.c: fix.o vecmata.o - -# 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/maths/fixc.c b/maths/fixc.c index 1380a2b5..5c472ca0 100644 --- a/maths/fixc.c +++ b/maths/fixc.c @@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/maths/fixc.c,v $ - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:29:58 $ + * $Date: 2001-01-31 15:18:04 $ * * C version of fixed point library * * $Log: not supported by cvs2svn $ + * Revision 1.1.1.1 2001/01/19 03:29:58 bradleyb + * Import of d2x-0.0.8 + * * Revision 1.3 1999/10/18 00:31:01 donut * more alpha fixes from Falk Hueffner * @@ -58,21 +61,21 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: fixc.c,v 1.1.1.1 2001-01-19 03:29:58 bradleyb Exp $"; +static char rcsid[] = "$Id: fixc.c,v 1.2 2001-01-31 15:18:04 bradleyb Exp $"; #endif -#include -#include "maths.h" - -#ifdef NO_ASM #include #include #include "error.h" #include "maths.h" +#ifndef NO_ASM #ifdef NO_FIX_INLINE #ifdef _MSC_VER #pragma message ("warning: FIX NOT INLINED") @@ -80,6 +83,7 @@ static char rcsid[] = "$Id: fixc.c,v 1.1.1.1 2001-01-19 03:29:58 bradleyb Exp $" #warning "FIX NOT INLINED" #endif #endif +#endif extern ubyte guess_table[]; extern short sincos_table[]; @@ -555,4 +559,3 @@ fix fix_isqrt( fix a ) return r; } -#endif // NO_ASM diff --git a/maths/rand.c b/maths/rand.c index 899980a1..69a0b562 100644 --- a/maths/rand.c +++ b/maths/rand.c @@ -1,7 +1,10 @@ // Descent random number stuff... // rand has different ranges on different machines... +#ifdef HAVE_CONFIG_H #include +#endif + #include #ifdef NO_WATCOM_RAND diff --git a/maths/tables.c b/maths/tables.c index 03a1e49b..b278adc6 100644 --- a/maths/tables.c +++ b/maths/tables.c @@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/maths/tables.c,v $ - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:29:58 $ + * $Date: 2001-01-31 15:18:04 $ * * C version of fixed point library * * $Log: not supported by cvs2svn $ + * Revision 1.1.1.1 2001/01/19 03:29:58 bradleyb + * Import of d2x-0.0.8 + * * Revision 1.1.1.1 1999/06/14 22:13:38 donut * Import of d1x 1.37 source. * @@ -30,7 +33,10 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H #include +#endif + #include "maths.h" ubyte guess_table[] = { diff --git a/maths/vecmat.c b/maths/vecmat.c index 980c28c2..592c4578 100644 --- a/maths/vecmat.c +++ b/maths/vecmat.c @@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/maths/vecmat.c,v $ - * $Revision: 1.1.1.2 $ + * $Revision: 1.2 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:33:42 $ + * $Date: 2001-01-31 15:18:04 $ * * C version of vecmat library * * $Log: not supported by cvs2svn $ + * Revision 1.1.1.2 2001/01/19 03:33:42 bradleyb + * Import of d2x-0.0.9-pre1 + * * Revision 1.1.1.1 1999/06/14 22:13:42 donut * Import of d1x 1.37 source. * @@ -46,11 +49,14 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef RCS -static char rcsid[] = "$Id: vecmat.c,v 1.1.1.2 2001-01-19 03:33:42 bradleyb Exp $"; +static char rcsid[] = "$Id: vecmat.c,v 1.2 2001-01-31 15:18:04 bradleyb Exp $"; #endif -#include #include #include // for sqrt diff --git a/mem/Makefile.in b/mem/Makefile.in deleted file mode 100644 index f75af732..00000000 --- a/mem/Makefile.in +++ /dev/null @@ -1,299 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# 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. - -# 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. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CFLAGS = @CFLAGS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NASM = @NASM@ -NASMFLAGS = @NASMFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -SDL_LIBS = @SDL_LIBS@ -VERSION = @VERSION@ - -noinst_LIBRARIES = libmem.a -INCLUDES = -I $(top_srcdir)/includes - -libmem_a_SOURCES = mem.c -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../conf.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I.. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -libmem_a_LIBADD = -libmem_a_OBJECTS = mem.o -AR = ar -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -DEP_FILES = .deps/mem.P -SOURCES = $(libmem_a_SOURCES) -OBJECTS = $(libmem_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu mem/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -.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: - -libmem.a: $(libmem_a_OBJECTS) $(libmem_a_DEPENDENCIES) - -rm -f libmem.a - $(AR) cru libmem.a $(libmem_a_OBJECTS) $(libmem_a_LIBADD) - $(RANLIB) libmem.a - -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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - 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 = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = mem - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu mem/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - 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 - @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 -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -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-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-depend mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - 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-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags 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 \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -# 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/mem/mem.c b/mem/mem.c index 9a021aa3..f1c3ed33 100644 --- a/mem/mem.c +++ b/mem/mem.c @@ -13,7 +13,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #ifdef RCS -static char rcsid[] = "$Id: mem.c,v 1.1.1.1 2001-01-19 03:29:58 bradleyb Exp $"; +static char rcsid[] = "$Id: mem.c,v 1.4 2001-08-02 22:02:37 thimo Exp $"; #endif @@ -68,18 +68,14 @@ static char rcsid[] = "$Id: mem.c,v 1.1.1.1 2001-01-19 03:29:58 bradleyb Exp $"; #define MAX_INDEX 10000 -static unsigned int MallocBase[MAX_INDEX]; +static void *MallocBase[MAX_INDEX]; static unsigned int MallocSize[MAX_INDEX]; -static unsigned int MallocRealSize[MAX_INDEX]; static unsigned char Present[MAX_INDEX]; static char * Filename[MAX_INDEX]; static char * Varname[MAX_INDEX]; static int LineNum[MAX_INDEX]; static int BytesMalloced = 0; -static unsigned int SmallestAddress = 0xFFFFFFF; -static unsigned int LargestAddress = 0x0; - int show_mem_info = 1; static int free_list[MAX_INDEX]; @@ -105,16 +101,12 @@ void mem_init() free_list[i] = i; MallocBase[i] = 0; MallocSize[i] = 0; - MallocRealSize[i] = 0; Present[i] = 0; Filename[i] = NULL; Varname[i] = NULL; LineNum[i] = 0; } - SmallestAddress = 0xFFFFFFF; - LargestAddress = 0x0; - num_blocks = 0; LargestIndex = 0; @@ -168,11 +160,10 @@ void PrintInfo( int id ) void * mem_malloc( unsigned int size, char * var, char * filename, int line, int fill_zero ) { - unsigned int base; + void *base; int i, id; void *ptr; char * pc; - int * data; if (Initialized==0) mem_init(); @@ -239,13 +230,9 @@ void * mem_malloc( unsigned int size, char * var, char * filename, int line, int Error( "MEM_OUT_OF_MEMORY" ); } - base = (unsigned int)ptr; - if ( base < SmallestAddress ) SmallestAddress = base; - if ( (base+size) > LargestAddress ) LargestAddress = base+size; + base = (void *)ptr; - MallocBase[id] = (unsigned int)ptr; - data = (ssize_t *)((ssize_t)MallocBase[id]-4); - MallocRealSize[id] = *data; + MallocBase[id] = (void *)ptr; MallocSize[id] = size; Varname[id] = var; Filename[id] = filename; @@ -271,9 +258,9 @@ int mem_find_id( void * buffer ) int i; for (i=0; i<=LargestIndex; i++ ) - if (Present[i]==1) - if (MallocBase[i] == (unsigned int)buffer ) - return i; + if (Present[i]==1) + if (MallocBase[i] == buffer ) + return i; // Didn't find id. return -1; @@ -281,24 +268,11 @@ int mem_find_id( void * buffer ) int mem_check_integrity( int block_number ) { -#ifdef CHECK_DWORD_BELOW - int * data; -#endif int i, ErrorCount; ubyte * CheckData; CheckData = (char *)(MallocBase[block_number] + MallocSize[block_number]); -#ifdef CHECK_DWORD_BELOW - data = (int *)((int)MallocBase[block_number]-4); - - if ( *data != MallocRealSize[block_number] ) { - fprintf( stderr, "\nMEM_BAD_LENGTH: The length field of an allocated block was overwritten.\n" ); - PrintInfo( block_number ); - //Int3(); - *data = MallocRealSize[block_number]; - } -#endif ErrorCount = 0; for (i=0; i /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - 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 - @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 -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -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-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-depend mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - 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-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags 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 \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -# checker.c - -#checker.o: checker.c -# gcc -c -g $< -o $@ $(INCLUDES) $(CFLAGS) -I/usr/lib/checker/i686-pc-linux-gnu/include -I.. -I. - -# 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/misc/args.c b/misc/args.c index 275403f4..fe031943 100644 --- a/misc/args.c +++ b/misc/args.c @@ -12,13 +12,19 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/misc/args.c,v $ - * $Revision: 1.1.1.1 $ + * $Revision: 1.3 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:30:14 $ + * $Date: 2001-01-31 15:18:04 $ * * Functions for accessing arguments. * * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/01/24 04:29:48 bradleyb + * changed args_find to FindArg + * + * Revision 1.1.1.1 2001/01/19 03:30:14 bradleyb + * Import of d2x-0.0.8 + * * Revision 1.3 1999/08/05 22:53:41 sekmu * * D3D patch(es) from ADB @@ -64,12 +70,14 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: args.c,v 1.1.1.1 2001-01-19 03:30:14 bradleyb Exp $"; +static char rcsid[] = "$Id: args.c,v 1.3 2001-01-31 15:18:04 bradleyb Exp $"; #endif -#include #include #include #include @@ -82,7 +90,7 @@ static char rcsid[] = "$Id: args.c,v 1.1.1.1 2001-01-19 03:30:14 bradleyb Exp $" int Num_args=0; char * Args[100]; -int args_find( char * s ) { +int FindArg( char * s ) { int i; for (i=0; i +#endif + #include #include diff --git a/misc/d_delay.c b/misc/d_delay.c index a2d6f5c2..06ffb727 100644 --- a/misc/d_delay.c +++ b/misc/d_delay.c @@ -1,10 +1,14 @@ //added on 9/2/98 by Matt Mueller + +#ifdef HAVE_CONFIG_H #include +#endif + #include "d_delay.h" #ifndef d_delay -#ifdef __WINDOWS__ +#if defined __WINDOWS__ || defined __MINGW32__ #include diff --git a/misc/d_glob.c b/misc/d_glob.c index 1c619b71..0a5a4aa0 100644 --- a/misc/d_glob.c +++ b/misc/d_glob.c @@ -1,5 +1,9 @@ /* Globbing functions for descent. Calls the relevant system handlers... */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "d_glob.h" #include "error.h" #include @@ -7,7 +11,7 @@ #include "u_mem.h" //end addition -MM -#if defined(__DJGPP__) || defined(__LINUX__) +#if defined(__ENV_DJGPP__) || defined(__ENV_LINUX__) #include int d_glob(const char *pattern, d_glob_t *g) @@ -27,7 +31,7 @@ int d_glob(const char *pattern, d_glob_t *g) void d_globfree(d_glob_t *g) { -#ifndef __LINUX__ // Linux doesn't believe in freeing glob structures... :-) +#ifndef __ENV_LINUX__ // Linux doesn't believe in freeing glob structures... :-) glob_t a; Assert (g!=NULL); diff --git a/misc/d_io.c b/misc/d_io.c index 1e7ab075..a68f9758 100644 --- a/misc/d_io.c +++ b/misc/d_io.c @@ -1,6 +1,10 @@ // some misc. file/disk routines // Arne de Bruijn, 1998 + +#ifdef HAVE_CONFIG_H #include +#endif + #include #include #include "d_io.h" diff --git a/misc/error.c b/misc/error.c index fdf6f277..33336c2f 100644 --- a/misc/error.c +++ b/misc/error.c @@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/misc/error.c,v $ - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:30:14 $ + * $Date: 2001-01-31 15:18:04 $ * * Error handling/printing/exiting code * * $Log: not supported by cvs2svn $ + * Revision 1.1.1.1 2001/01/19 03:30:14 bradleyb + * Import of d2x-0.0.8 + * * Revision 1.1.1.1 1999/06/14 22:13:48 donut * Import of d1x 1.37 source. * @@ -62,11 +65,14 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef RCS -static char rcsid[] = "$Id: error.c,v 1.1.1.1 2001-01-19 03:30:14 bradleyb Exp $"; +static char rcsid[] = "$Id: error.c,v 1.2 2001-01-31 15:18:04 bradleyb Exp $"; #endif -#include #include #include #include diff --git a/misc/hash.c b/misc/hash.c index de4eecba..1608a1aa 100644 --- a/misc/hash.c +++ b/misc/hash.c @@ -11,11 +11,14 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifdef RCS -static char rcsid[] = "$Id: hash.c,v 1.1.1.1 2001-01-19 03:30:14 bradleyb Exp $"; +static char rcsid[] = "$Id: hash.c,v 1.2 2001-01-31 15:18:04 bradleyb Exp $"; #endif -#include #include #include #include diff --git a/misc/strio.c b/misc/strio.c index 3a7a82dd..93173825 100644 --- a/misc/strio.c +++ b/misc/strio.c @@ -1,5 +1,9 @@ /**strio.c: string/file manipulation functions by Victor Rachels **/ + +#ifdef HAVE_CONFIG_H #include +#endif + #include #include #include "strio.h" diff --git a/misc/strutil.c b/misc/strutil.c index c484341a..434533e4 100644 --- a/misc/strutil.c +++ b/misc/strutil.c @@ -11,7 +11,10 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ +#ifdef HAVE_CONFIG_H #include +#endif + #include #include #include @@ -31,7 +34,7 @@ char *d_strdup(char *str) } -#if !defined __ENV_LINUX__ && !defined __ENV_DJGPP__ +#if 0 // string compare without regard to case int stricmp( char *s1, char *s2 ) @@ -56,11 +59,10 @@ int strnicmp( char *s1, char *s2, int n ) if (n) return 1; return 0; } - #endif +#ifndef __MINGW32__ #ifndef __ENV_DJGPP__ - void strlwr( char *s1 ) { while( *s1 ) { @@ -142,6 +144,7 @@ void _splitpath(char *name, char *drive, char *path, char *base, char *ext) if (ext) strcpy(ext, p); } +#endif #if 0 void main() diff --git a/sound/Makefile.am b/sound/Makefile.am index 38e119d1..6f86f575 100644 --- a/sound/Makefile.am +++ b/sound/Makefile.am @@ -1,4 +1,11 @@ -noinst_LIBRARIES = libsound.a INCLUDES = -I $(top_srcdir) -I$(top_srcdir)/includes -I$(top_srcdir)/main -libsound_a_SOURCES = sdl_digi.c sdl_cdrom.c \ -dos_digi.c dos_cdrom.c + +noinst_LIBRARIES = libsound.a + +if ENV_DJGPP +libsound_a_SOURCES = dos_digi.c dos_cdrom.c +else +libsound_a_SOURCES = sdl_digi.c sdl_cdrom.c +endif + +EXTRA_libsound_a_SOURCES = sdl_digi.c sdl_cdrom.c dos_digi.c dos_cdrom.c diff --git a/sound/Makefile.in b/sound/Makefile.in deleted file mode 100644 index 35d8502d..00000000 --- a/sound/Makefile.in +++ /dev/null @@ -1,300 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# 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. - -# 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. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CFLAGS = @CFLAGS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NASM = @NASM@ -NASMFLAGS = @NASMFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -SDL_LIBS = @SDL_LIBS@ -VERSION = @VERSION@ - -noinst_LIBRARIES = libsound.a -INCLUDES = -I $(top_srcdir) -I$(top_srcdir)/includes -I$(top_srcdir)/main -libsound_a_SOURCES = sdl_digi.c sdl_cdrom.c dos_digi.c dos_cdrom.c - -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../conf.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I.. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -libsound_a_LIBADD = -libsound_a_OBJECTS = sdl_digi.o sdl_cdrom.o dos_digi.o dos_cdrom.o -AR = ar -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -DEP_FILES = .deps/dos_cdrom.P .deps/dos_digi.P .deps/sdl_cdrom.P \ -.deps/sdl_digi.P -SOURCES = $(libsound_a_SOURCES) -OBJECTS = $(libsound_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu sound/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -.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: - -libsound.a: $(libsound_a_OBJECTS) $(libsound_a_DEPENDENCIES) - -rm -f libsound.a - $(AR) cru libsound.a $(libsound_a_OBJECTS) $(libsound_a_LIBADD) - $(RANLIB) libsound.a - -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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - 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 = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = sound - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu sound/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - 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 - @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 -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -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-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-depend mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - 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-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags 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 \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -# 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/sound/dos_cdrom.c b/sound/dos_cdrom.c index b812a850..09d32dcf 100644 --- a/sound/dos_cdrom.c +++ b/sound/dos_cdrom.c @@ -1,6 +1,22 @@ -/* DPH: This is the file where all the stub functions go. The aim is to have nothing in here ,eventually */ +/* + * $Source: /cvs/cvsroot/d2x/sound/dos_cdrom.c,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-01-31 14:04:45 $ + * + * DPH: This is the file where all the stub functions go. + * The aim is to have nothing in here, eventually + * + * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/01/29 13:53:28 bradleyb + * Fixed build, minor fixes + * + */ + +#ifdef HAVE_CONFIG_H #include -#ifdef __ENV_DJGPP__ +#endif + #include #include #include "pstypes.h" @@ -13,10 +29,17 @@ static int initialised = 0; void RBAExit() { + if (initialised) { + /* FIXME: Close cdrom device */ + } } void RBAInit() { + if (initialised) return; + if (FindArg("-nocdrom")) return; + + /* FIXME: Initialize cdrom device */ } @@ -76,5 +99,3 @@ int CD_blast_mixer() { return 0; } - -#endif // __ENV_DJGPP__ diff --git a/sound/dos_digi.c b/sound/dos_digi.c index f0e17444..cd49172e 100644 --- a/sound/dos_digi.c +++ b/sound/dos_digi.c @@ -1,7 +1,21 @@ -// SDL digital audio support +/* + * $Source: /cvs/cvsroot/d2x/sound/dos_digi.c,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-01-31 14:04:45 $ + * + * DOS digital audio support + * + * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/01/29 13:53:28 bradleyb + * Fixed build, minor fixes + * + */ +#ifdef HAVE_CONFIG_H #include -#ifdef __ENV_DJGPP__ +#endif + #include #include #include @@ -227,6 +241,10 @@ static void audio_mixcallback(void *userdata, unsigned char *stream, int len) /* Initialise audio devices. */ int digi_init() { + /* this is just here now to stop gcc from complaining about + * audio_mixcallback being declared static and not used... + */ + if (0) audio_mixcallback(NULL,NULL,0); return 1; } @@ -809,5 +827,3 @@ void digi_reset_digi_sounds() { //#endif //} //end this section kill - MM - -#endif // __ENV_DJGPP__ diff --git a/sound/sdl_cdrom.c b/sound/sdl_cdrom.c index 7f099305..2187feb0 100644 --- a/sound/sdl_cdrom.c +++ b/sound/sdl_cdrom.c @@ -1,7 +1,19 @@ -/* DPH: This is the file where all the stub functions go. The aim is to have nothing in here ,eventually */ +/* + * $Source: /cvs/cvsroot/d2x/sound/sdl_cdrom.c,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 13:53:28 $ + * + * DPH: This is the file where all the stub functions go. + * The aim is to have nothing in here, eventually + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include +#endif -#ifdef SDL_AUDIO #include #include #include @@ -26,7 +38,7 @@ void RBAExit() void RBAInit() { if (initialised) return; - if (args_find("-nocdrom")) return; + if (FindArg("-nocdrom")) return; if (SDL_Init(SDL_INIT_CDROM) < 0) { @@ -120,5 +132,3 @@ int CD_blast_mixer() { return 0; } - -#endif //SDL_AUDIO diff --git a/sound/sdl_digi.c b/sound/sdl_digi.c index 940967c5..08162b83 100644 --- a/sound/sdl_digi.c +++ b/sound/sdl_digi.c @@ -1,8 +1,18 @@ -// SDL digital audio support +/* + * $Source: /cvs/cvsroot/d2x/sound/sdl_digi.c,v $ + * $Revision: 1.2 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 13:53:28 $ + * + * SDL digital audio support + * + * $Log: not supported by cvs2svn $ + */ +#ifdef HAVE_CONFIG_H #include +#endif -#ifdef SDL_AUDIO #include #include #include @@ -842,5 +852,3 @@ void digi_reset_digi_sounds() { //#endif //} //end this section kill - MM - -#endif // SDL_AUDIO diff --git a/stamp-h.in b/stamp-h.in deleted file mode 100644 index e69de29b..00000000 diff --git a/texmap/Makefile.am b/texmap/Makefile.am index 62db09c6..5333b766 100644 --- a/texmap/Makefile.am +++ b/texmap/Makefile.am @@ -1,17 +1,22 @@ noinst_LIBRARIES = libtexmap.a INCLUDES = -I $(top_srcdir)/includes -DFL1_WITH_FLAT +if USE_ASM libtexmap_a_SOURCES = ntmap.c tmapflat.c +else +libtexmap_a_SOURCES = ntmap.c tmapflat.c scanline.c +endif -if USE_ASM - SUFFIXES = .asm - %.o: %.asm +SUFFIXES = .asm +%.o: %.asm $(NASM) $(NASMFLAGS) $< -o $@ - libtexmap_a_SOURCES += tmapppro.S tmap_ll.asm tmap_flt.asm tmap_lin.asm tmapfade.asm - libtexmap_a_LIBADD += tmapppro.o tmap_ll.o tmap_flt.o tmap_lin.o tmapfade.o - ntmap.c tmapflat.c: tmapppro.o tmap_ll.o tmap_flt.o tmap_lin.o tmapfade.o -else - libtexmap_a_SOURCES += scanline.c - libtexmap_a_LIBADD += scanline.o - ntmap.c tmapflat.c: scanline.o + +if USE_ASM +libtexmap_a_LIBADD += tmapppro.o tmap_ll.o tmap_flt.o tmap_lin.o tmapfade.o endif + +EXTRA_DIST = \ +tmap_flt.asm tmap_inc.asm tmap_lin.asm tmap_ll.asm tmap_per.asm tmapfade.asm \ +tmappent.S tmapppro.S \ +scanline.h texmapl.h \ +scanline.c diff --git a/texmap/Makefile.in b/texmap/Makefile.in deleted file mode 100644 index 61db4ee7..00000000 --- a/texmap/Makefile.in +++ /dev/null @@ -1,309 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# 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. - -# 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. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CFLAGS = @CFLAGS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NASM = @NASM@ -NASMFLAGS = @NASMFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -SDL_LIBS = @SDL_LIBS@ -VERSION = @VERSION@ - -noinst_LIBRARIES = libtexmap.a -INCLUDES = -I $(top_srcdir)/includes -DFL1_WITH_FLAT - -libtexmap_a_SOURCES = ntmap.c tmapflat.c -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../conf.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I.. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -libtexmap_a_LIBADD = -libtexmap_a_OBJECTS = ntmap.o tmapflat.o -AR = ar -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -DEP_FILES = .deps/ntmap.P .deps/tmapflat.P -SOURCES = $(libtexmap_a_SOURCES) -OBJECTS = $(libtexmap_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu texmap/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -.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: - -libtexmap.a: $(libtexmap_a_OBJECTS) $(libtexmap_a_DEPENDENCIES) - -rm -f libtexmap.a - $(AR) cru libtexmap.a $(libtexmap_a_OBJECTS) $(libtexmap_a_LIBADD) - $(RANLIB) libtexmap.a - -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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - 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 = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = texmap - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu texmap/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - 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 - @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 -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -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-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-depend mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - 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-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags 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 \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -@USE_ASM_TRUE@ SUFFIXES = .asm -@USE_ASM_TRUE@ %.o: %.asm -@USE_ASM_TRUE@ $(NASM) $(NASMFLAGS) $< -o $@ -@USE_ASM_TRUE@ libtexmap_a_SOURCES += tmapppro.S tmap_ll.asm tmap_flt.asm tmap_lin.asm tmapfade.asm -@USE_ASM_TRUE@ libtexmap_a_LIBADD += tmapppro.o tmap_ll.o tmap_flt.o tmap_lin.o tmapfade.o -@USE_ASM_TRUE@ ntmap.c tmapflat.c: tmapppro.o tmap_ll.o tmap_flt.o tmap_lin.o tmapfade.o -@USE_ASM_FALSE@ libtexmap_a_SOURCES += scanline.c -@USE_ASM_FALSE@ libtexmap_a_LIBADD += scanline.o -@USE_ASM_FALSE@ ntmap.c tmapflat.c: scanline.o - -# 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/texmap/ntmap.c b/texmap/ntmap.c index a1eeb96d..2792a464 100644 --- a/texmap/ntmap.c +++ b/texmap/ntmap.c @@ -12,13 +12,19 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/texmap/ntmap.c,v $ - * $Revision: 1.1.1.1 $ + * $Revision: 1.3 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:30:16 $ + * $Date: 2001-01-31 15:18:04 $ * * Start of conversion to new texture mapper. * * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/01/31 14:04:46 bradleyb + * Fix compiler warnings + * + * Revision 1.1.1.1 2001/01/19 03:30:16 bradleyb + * Import of d2x-0.0.8 + * * Revision 1.4 1999/10/18 00:31:55 donut * allow FP_TMAP to be used without NO_ASM * @@ -133,11 +139,13 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ -#ifdef RCS -static char rcsid[] = "$Id: ntmap.c,v 1.1.1.1 2001-01-19 03:30:16 bradleyb Exp $"; +#ifdef HAVE_CONFIG_H +#include #endif -#include +#ifdef RCS +static char rcsid[] = "$Id: ntmap.c,v 1.3 2001-01-31 15:18:04 bradleyb Exp $"; +#endif #define VESA 0 #define NUM_TMAPS 16 @@ -157,6 +165,9 @@ static char rcsid[] = "$Id: ntmap.c,v 1.1.1.1 2001-01-19 03:30:16 bradleyb Exp $ #include "texmap.h" #include "texmapl.h" +#ifdef NO_ASM +#include "scanline.h" +#endif //#include "../main/textures.h" diff --git a/texmap/scanline.c b/texmap/scanline.c index 3f3925dd..3aa399be 100644 --- a/texmap/scanline.c +++ b/texmap/scanline.c @@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/texmap/scanline.c,v $ - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:30:16 $ + * $Date: 2001-01-31 15:18:04 $ * * Routines to draw the texture mapped scanlines. * * $Log: not supported by cvs2svn $ + * Revision 1.1.1.1 2001/01/19 03:30:16 bradleyb + * Import of d2x-0.0.8 + * * Revision 1.4 1999/10/18 00:31:01 donut * more alpha fixes from Falk Hueffner * @@ -40,12 +43,14 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef RCS -static char rcsid[] = "$Id: scanline.c,v 1.1.1.1 2001-01-19 03:30:16 bradleyb Exp $"; +static char rcsid[] = "$Id: scanline.c,v 1.2 2001-01-31 15:18:04 bradleyb Exp $"; #endif -#include #include #include #include diff --git a/texmap/tmapflat.c b/texmap/tmapflat.c index 8a12b9d0..6c657222 100644 --- a/texmap/tmapflat.c +++ b/texmap/tmapflat.c @@ -12,13 +12,19 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/texmap/tmapflat.c,v $ - * $Revision: 1.1.1.1 $ + * $Revision: 1.3 $ * $Author: bradleyb $ - * $Date: 2001-01-19 03:30:16 $ + * $Date: 2001-01-31 15:18:05 $ * * Flat shader derived from texture mapper (a little slow) * * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/01/31 14:04:46 bradleyb + * Fix compiler warnings + * + * Revision 1.1.1.1 2001/01/19 03:30:16 bradleyb + * Import of d2x-0.0.8 + * * Revision 1.2 1999/10/07 21:03:29 donut * OGL rendering of cloaked stuff * @@ -70,7 +76,9 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ +#ifdef HAVE_CONFIG_H #include +#endif #include "fix.h" #include "vecmat.h" @@ -78,6 +86,9 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "grdef.h" #include "texmap.h" #include "texmapl.h" +#ifdef NO_ASM +#include "scanline.h" +#endif //#include "tmapext.h" diff --git a/tools/Makefile.am b/tools/Makefile.am new file mode 100644 index 00000000..4f266314 --- /dev/null +++ b/tools/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = cvs2cl diff --git a/tools/cvs2cl/Makefile.am b/tools/cvs2cl/Makefile.am new file mode 100644 index 00000000..a7f30b05 --- /dev/null +++ b/tools/cvs2cl/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ +cvs2cl.pl diff --git a/tools/cvs2cl/cvs2cl.pl b/tools/cvs2cl/cvs2cl.pl new file mode 100644 index 00000000..820b5ece --- /dev/null +++ b/tools/cvs2cl/cvs2cl.pl @@ -0,0 +1,1787 @@ +#!/bin/sh +exec perl -w -x $0 ${1+"$@"} # -*- mode: perl; perl-indent-level: 2; -*- +#!perl -w + +############################################################## +### ### +### cvs2cl.pl: produce ChangeLog(s) from `cvs log` output. ### +### ### +############################################################## + +## $Revision: 1.1 $ +## $Date: 2001-01-24 11:20:22 $ +## $Author: bradleyb $ +## +## (C) 1999 Karl Fogel , under the GNU GPL. +## +## (Extensively hacked on by Melissa O'Neill .) +## +## cvs2cl.pl is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2, or (at your option) +## any later version. +## +## cvs2cl.pl is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You may have received a copy of the GNU General Public License +## along with cvs2cl.pl; see the file COPYING. If not, write to the +## Free Software Foundation, Inc., 59 Temple Place - Suite 330, +## Boston, MA 02111-1307, USA. + + + +use strict; +use Text::Wrap; +use Time::Local; +use File::Basename; + + +# The Plan: +# +# Read in the logs for multiple files, spit out a nice ChangeLog that +# mirrors the information entered during `cvs commit'. +# +# The problem presents some challenges. In an ideal world, we could +# detect files with the same author, log message, and checkin time -- +# each would be a changelog entry. +# We'd sort them; and spit them out. Unfortunately, CVS is *not atomic* +# so checkins can span a range of times. Also, the directory structure +# could be hierarchical. +# +# Another question is whether we really want to have the ChangeLog +# exactly reflect commits. An author could issue two related commits, +# with different log entries, reflecting a single logical change to the +# source. GNU style ChangeLogs group these under a single author/date. +# We try to do the same. +# +# So, we parse the output of `cvs log', storing log messages in a +# multilevel hash that stores the mapping: +# directory => author => time => message => filelist +# As we go, we notice "nearby" commit times and store them together +# (i.e., under the same timestamp), so they appear in the same log +# entry. +# +# When we've read all the logs, we twist this mapping into +# a time => author => message => filelist mapping for each directory. +# +# If we're not using the `--distributed' flag, the directory is always +# considered to be `./', even as descend into subdirectories. + + +############### Globals ################ + + +# What we run to generate it: +my $Log_Source_Command = "cvs log"; + +# In case we have to print it out: +my $VERSION = '$Revision: 1.1 $'; +$VERSION =~ s/\S+\s+(\S+)\s+\S+/$1/; + +## Vars set by options: + +# Print debugging messages? +my $Debug = 0; + +# Just show version and exit? +my $Print_Version = 0; + +# Just print usage message and exit? +my $Print_Usage = 0; + +# Single top-level ChangeLog, or one per subdirectory? +my $Distributed = 0; + +# What file should we generate (defaults to "ChangeLog")? +my $Log_File_Name = "ChangeLog"; + +# Expand usernames to email addresses based on a map file? +my $User_Map_File = ""; + +# Output to a file or to stdout? +my $Output_To_Stdout = 0; + +# Eliminate empty log messages? +my $Prune_Empty_Msgs = 0; + +# Don't call Text::Wrap on the body of the message +my $No_Wrap = 0; + +# Separates header from log message. Code assumes it is either " " or +# "\n\n", so if there's ever an option to set it to something else, +# make sure to go through all conditionals that use this var. +my $After_Header = " "; + +# Format more for programs than for humans. +my $XML_Output = 0; + +# Do some special tweaks for log data that was written in FSF +# ChangeLog style. +my $FSF_Style = 0; + +# Show times in UTC instead of local time +my $UTC_Times = 0; + +# Show day of week in output? +my $Show_Day_Of_Week = 0; + +# Show revision numbers in output? +my $Show_Revisions = 0; + +# Show tags (symbolic names) in output? +my $Show_Tags = 0; + +# Show branches by symbolic name in output? +my $Show_Branches = 0; + +# Show only revisions on these branches or their ancestors. +my @Follow_Branches; + +# Don't bother with files matching this regexp. +my @Ignore_Files; + +# How exactly we match entries. We definitely want "o", +# and user might add "i" by using --case-insensitive option. +my $Case_Insensitive = 0; + +# Maybe only show log messages matching a certain regular expression. +my $Regexp_Gate = ""; + +# Pass this global option string along to cvs, to the left of `log': +my $Global_Opts = ""; + +# Pass this option string along to the cvs log subcommand: +my $Command_Opts = ""; + +# Read log output from stdin instead of invoking cvs log? +my $Input_From_Stdin = 0; + +# Don't show filenames in output. +my $Hide_Filenames = 0; + +# Max checkin duration. CVS checkin is not atomic, so we may have checkin +# times that span a range of time. We assume that checkins will last no +# longer than $Max_Checkin_Duration seconds, and that similarly, no +# checkins will happen from the same users with the same message less +# than $Max_Checkin_Duration seconds apart. +my $Max_Checkin_Duration = 180; + +# What to put at the front of [each] ChangeLog. +my $ChangeLog_Header = ""; + +## end vars set by options. + +# In 'cvs log' output, one long unbroken line of equal signs separates +# files: +my $file_separator = "=======================================" + . "======================================"; + +# In 'cvs log' output, a shorter line of dashes separates log messages +# within a file: +my $logmsg_separator = "----------------------------"; + + +############### End globals ############ + + + + +&parse_options (); +&derive_change_log (); + + + +### Everything below is subroutine definitions. ### + +# Fills up a ChangeLog structure in the current directory. +sub derive_change_log () +{ + # See "The Plan" above for a full explanation. + + my %grand_poobah; + + my $file_full_path; + my $time; + my $revision; + my $author; + my $msg_txt; + my $detected_file_separator; + + # We might be expanding usernames + my %usermap; + + # In general, it's probably not very maintainable to use state + # variables like this to tell the loop what it's doing at any given + # moment, but this is only the first one, and if we never have more + # than a few of these, it's okay. + my $collecting_symbolic_names = 0; + my %symbolic_names; # Where tag names get stored. + my %branch_names; # We'll grab branch names while we're at it. + my %branch_numbers; # Save some revisions for @Follow_Branches + my @branch_roots; # For showing which files are branch ancestors. + + # Bleargh. Compensate for a deficiency of custom wrapping. + if (($After_Header ne " ") and $FSF_Style) + { + $After_Header .= "\t"; + } + + if (! $Input_From_Stdin) { + open (LOG_SOURCE, "$Log_Source_Command |") + or die "unable to run \"${Log_Source_Command}\""; + } + else { + open (LOG_SOURCE, "-") or die "unable to open stdin for reading"; + } + + %usermap = &maybe_read_user_map_file (); + + while () + { + # If on a new file and don't see filename, skip until we find it, and + # when we find it, grab it. + if ((! (defined $file_full_path)) and /^Working file: (.*)/) + { + $file_full_path = $1; + if (@Ignore_Files) + { + my $base; + ($base, undef, undef) = fileparse ($file_full_path); + # Ouch, I wish trailing operators in regexps could be + # evaluated on the fly! + if ($Case_Insensitive) { + if (grep ($file_full_path =~ m|$_|i, @Ignore_Files)) { + undef $file_full_path; + } + } + elsif (grep ($file_full_path =~ m|$_|, @Ignore_Files)) { + undef $file_full_path; + } + } + next; + } + + # Just spin wheels if no file defined yet. + next if (! $file_full_path); + + # Collect tag names in case we're asked to print them in the output. + if (/^symbolic names:$/) { + $collecting_symbolic_names = 1; + next; # There's no more info on this line, so skip to next + } + if ($collecting_symbolic_names) + { + # All tag names are listed with whitespace in front in cvs log + # output; so if see non-whitespace, then we're done collecting. + if (/^\S/) { + $collecting_symbolic_names = 0; + } + else # we're looking at a tag name, so parse & store it + { + # According to the Cederqvist manual, in node "Tags", tag + # names must start with an uppercase or lowercase letter and + # can contain uppercase and lowercase letters, digits, `-', + # and `_'. However, it's not our place to enforce that, so + # we'll allow anything CVS hands us to be a tag: + /^\s+([^:]+): ([\d.]+)$/; + my $tag_name = $1; + my $tag_rev = $2; + + # A branch number either has an odd number of digit sections + # (and hence an even number of dots), or has ".0." as the + # second-to-last digit section. Test for these conditions. + my $real_branch_rev = ""; + if (($tag_rev =~ /^(\d+\.\d+\.)+\d+$/) # Even number of dots... + and (! ($tag_rev =~ /^(1\.)+1$/))) # ...but not "1.[1.]1" + { + $real_branch_rev = $tag_rev; + } + elsif ($tag_rev =~ /(\d+\.(\d+\.)+)0.(\d+)/) # Has ".0." + { + $real_branch_rev = $1 . $3; + } + # If we got a branch, record its number. + if ($real_branch_rev) + { + $branch_names{$real_branch_rev} = $tag_name; + if (@Follow_Branches) { + if (grep ($_ eq $tag_name, @Follow_Branches)) { + $branch_numbers{$tag_name} = $real_branch_rev; + } + } + } + else { + # Else it's just a regular (non-branch) tag. + push (@{$symbolic_names{$tag_rev}}, $tag_name); + } + } + } + # End of code for collecting tag names. + + # If have file name, but not revision, and see revision, then grab + # it. (We collect unconditionally, even though we may or may not + # ever use it.) + if ((! (defined $revision)) and (/^revision (\d+\.[\d.]+)/)) + { + $revision = $1; + + if (@Follow_Branches) + { + foreach my $branch (@Follow_Branches) + { + # Special case for following trunk revisions + if (($branch =~ /^trunk$/i) and ($revision =~ /^[0-9]+\.[0-9]+$/)) + { + goto dengo; + } + + my $branch_number = $branch_numbers{$branch}; + if ($branch_number) + { + # Are we on one of the follow branches or an ancestor of + # same? + # + # If this revision is a prefix of the branch number, or + # possibly is less in the minormost number, OR if this + # branch number is a prefix of the revision, then yes. + # Otherwise, no. + # + # So below, we determine if any of those conditions are + # met. + + # Trivial case: is this revision on the branch? + # (Compare this way to avoid regexps that screw up Emacs + # indentation, argh.) + if ((substr ($revision, 0, ((length ($branch_number)) + 1))) + eq ($branch_number . ".")) + { + goto dengo; + } + # Non-trivial case: check if rev is ancestral to branch + elsif ((length ($branch_number)) > (length ($revision))) + { + $revision =~ /^((?:\d+\.)+)(\d+)$/; + my $r_left = $1; # still has the trailing "." + my $r_end = $2; + + $branch_number =~ /^((?:\d+\.)+)(\d+)\.\d+$/; + my $b_left = $1; # still has trailing "." + my $b_mid = $2; # has no trailing "." + + if (($r_left eq $b_left) + && ($r_end <= $b_mid)) + { + goto dengo; + } + } + } + } + } + else # (! @Follow_Branches) + { + next; + } + + # Else we are following branches, but this revision isn't on the + # path. So skip it. + undef $revision; + dengo: + next; + } + + # If we don't have a revision right now, we couldn't possibly + # be looking at anything useful. + if (! (defined ($revision))) { + $detected_file_separator = /^$file_separator$/o; + if ($detected_file_separator) { + # No revisions for this file; can happen, e.g. "cvs log -d DATE" + goto CLEAR; + } + else { + next; + } + } + + # If have file name but not date and author, and see date or + # author, then grab them: + unless (defined $time) + { + if (/^date: .*/) + { + ($time, $author) = &parse_date_and_author ($_); + if (defined ($usermap{$author}) and $usermap{$author}) { + $author = $usermap{$author}; + } + } + else { + $detected_file_separator = /^$file_separator$/o; + if ($detected_file_separator) { + # No revisions for this file; can happen, e.g. "cvs log -d DATE" + goto CLEAR; + } + } + # If the date/time/author hasn't been found yet, we couldn't + # possibly care about anything we see. So skip: + next; + } + + # A "branches: ..." line here indicates that one or more branches + # are rooted at this revision. If we're showing branches, then we + # want to show that fact as well, so we collect all the branches + # that this is the latest ancestor of and store them in + # @branch_roots. Just for reference, the format of the line we're + # seeing at this point is: + # + # branches: 1.5.2; 1.5.4; ...; + # + # Okay, here goes: + + if (/^branches:\s+(.*);$/) + { + if ($Show_Branches) + { + my $lst = $1; + $lst =~ s/(1\.)+1;|(1\.)+1$//; # ignore the trivial branch 1.1.1 + if ($lst) { + @branch_roots = split (/;\s+/, $lst); + } + else { + undef @branch_roots; + } + next; + } + else + { + # Ugh. This really bothers me. Suppose we see a log entry + # like this: + # + # ---------------------------- + # revision 1.1 + # date: 1999/10/17 03:07:38; author: jrandom; state: Exp; + # branches: 1.1.2; + # Intended first line of log message begins here. + # ---------------------------- + # + # The question is, how we can tell the difference between that + # log message and a *two*-line log message whose first line is + # + # "branches: 1.1.2;" + # + # See the problem? The output of "cvs log" is inherently + # ambiguous. + # + # For now, we punt: we liberally assume that people don't + # write log messages like that, and just toss a "branches:" + # line if we see it but are not showing branches. I hope no + # one ever loses real log data because of this. + next; + } + } + + # If have file name, time, and author, then we're just grabbing + # log message texts: + $detected_file_separator = /^$file_separator$/o; + if ($detected_file_separator && ! (defined $revision)) { + # No revisions for this file; can happen, e.g. "cvs log -d DATE" + goto CLEAR; + } + unless ($detected_file_separator || /^$logmsg_separator$/o) + { + $msg_txt .= $_; # Normally, just accumulate the message... + next; + } + # ... until a msg separator is encountered: + # Ensure the message contains something: + if ((! $msg_txt) + || ($msg_txt =~ /^\s*\.\s*$|^\s*$/) + || ($msg_txt =~ /\*\*\* empty log message \*\*\*/)) + { + if ($Prune_Empty_Msgs) { + goto CLEAR; + } + # else + $msg_txt = "[no log message]\n"; + } + + ### Store it all in the Grand Poobah: + { + my $dir_key; # key into %grand_poobah + my %qunk; # complicated little jobbie, see below + + # Each revision of a file has a little data structure (a `qunk') + # associated with it. That data structure holds not only the + # file's name, but any additional information about the file + # that might be needed in the output, such as the revision + # number, tags, branches, etc. The reason to have these things + # arranged in a data structure, instead of just appending them + # textually to the file's name, is that we may want to do a + # little rearranging later as we write the output. For example, + # all the files on a given tag/branch will go together, followed + # by the tag in parentheses (so trunk or otherwise non-tagged + # files would go at the end of the file list for a given log + # message). This rearrangement is a lot easier to do if we + # don't have to reparse the text. + # + # A qunk looks like this: + # + # { + # filename => "hello.c", + # revision => "1.4.3.2", + # time => a timegm() return value (moment of commit) + # tags => [ "tag1", "tag2", ... ], + # branch => "branchname" # There should be only one, right? + # branchroots => [ "branchtag1", "branchtag2", ... ] + # } + + if ($Distributed) { + # Just the basename, don't include the path. + ($qunk{'filename'}, $dir_key, undef) = fileparse ($file_full_path); + } + else { + $dir_key = "./"; + $qunk{'filename'} = $file_full_path; + } + + # This may someday be used in a more sophisticated calculation + # of what other files are involved in this commit. For now, we + # don't use it, because the common-commit-detection algorithm is + # hypothesized to be "good enough" as it stands. + $qunk{'time'} = $time; + + # We might be including revision numbers and/or tags and/or + # branch names in the output. Most of the code from here to + # loop-end deals with organizing these in qunk. + + $qunk{'revision'} = $revision; + + # Grab the branch, even though we may or may not need it: + $qunk{'revision'} =~ /((?:\d+\.)+)\d+/; + my $branch_prefix = $1; + $branch_prefix =~ s/\.$//; # strip off final dot + if ($branch_names{$branch_prefix}) { + $qunk{'branch'} = $branch_names{$branch_prefix}; + } + + # If there's anything in the @branch_roots array, then this + # revision is the root of at least one branch. We'll display + # them as branch names instead of revision numbers, the + # substitution for which is done directly in the array: + if (@branch_roots) { + my @roots = map { $branch_names{$_} } @branch_roots; + $qunk{'branchroots'} = \@roots; + } + + # Save tags too. + if (defined ($symbolic_names{$revision})) { + $qunk{'tags'} = $symbolic_names{$revision}; + delete $symbolic_names{$revision}; + } + + # Add this file to the list + # (We use many spoonfuls of autovivication magic. Hashes and arrays + # will spring into existence if they aren't there already.) + + &debug ("(pushing log msg for ${dir_key}$qunk{'filename'})\n"); + + # Store with the files in this commit. Later we'll loop through + # again, making sure that revisions with the same log message + # and nearby commit times are grouped together as one commit. + push (@{$grand_poobah{$dir_key}{$author}{$time}{$msg_txt}}, \%qunk); + } + + CLEAR: + # Make way for the next message + undef $msg_txt; + undef $time; + undef $revision; + undef $author; + undef @branch_roots; + + # Maybe even make way for the next file: + if ($detected_file_separator) { + undef $file_full_path; + undef %branch_names; + undef %branch_numbers; + undef %symbolic_names; + } + } + + close (LOG_SOURCE); + + ### Process each ChangeLog + + while (my ($dir,$authorhash) = each %grand_poobah) + { + &debug ("DOING DIR: $dir\n"); + + # Here we twist our hash around, from being + # author => time => message => filelist + # in %$authorhash to + # time => author => message => filelist + # in %changelog. + # + # This is also where we merge entries. The algorithm proceeds + # through the timeline of the changelog with a sliding window of + # $Max_Checkin_Duration seconds; within that window, entries that + # have the same log message are merged. + # + # (To save space, we zap %$authorhash after we've copied + # everything out of it.) + + my %changelog; + while (my ($author,$timehash) = each %$authorhash) + { + my $lasttime; + my %stamptime; + foreach my $time (sort {$main::a <=> $main::b} (keys %$timehash)) + { + my $msghash = $timehash->{$time}; + while (my ($msg,$qunklist) = each %$msghash) + { + my $stamptime = $stamptime{$msg}; + if ((defined $stamptime) + and (($time - $stamptime) < $Max_Checkin_Duration) + and (defined $changelog{$stamptime}{$author}{$msg})) + { + push(@{$changelog{$stamptime}{$author}{$msg}}, @$qunklist); + } + else { + $changelog{$time}{$author}{$msg} = $qunklist; + $stamptime{$msg} = $time; + } + } + } + } + undef (%$authorhash); + + ### Now we can write out the ChangeLog! + + my ($logfile_here, $logfile_bak, $tmpfile); + + if (! $Output_To_Stdout) { + $logfile_here = $dir . $Log_File_Name; + $logfile_here =~ s/^\.\/\//\//; # fix any leading ".//" problem + $tmpfile = "${logfile_here}.cvs2cl$$.tmp"; + $logfile_bak = "${logfile_here}.bak"; + + open (LOG_OUT, ">$tmpfile") or die "Unable to open \"$tmpfile\""; + } + else { + open (LOG_OUT, ">-") or die "Unable to open stdout for writing"; + } + + print LOG_OUT $ChangeLog_Header; + + if ($XML_Output) { + print LOG_OUT "\n\n" + . "\n\n"; + } + + foreach my $time (sort {$main::b <=> $main::a} (keys %changelog)) + { + my $authorhash = $changelog{$time}; + while (my ($author,$mesghash) = each %$authorhash) + { + # If XML, escape in outer loop to avoid compound quoting: + if ($XML_Output) { + $author = &xml_escape ($author); + } + + while (my ($msg,$qunklist) = each %$mesghash) + { + my $files = &pretty_file_list ($qunklist); + my $header_line; # date and author + my $body; # see below + my $wholething; # $header_line + $body + + # Set up the date/author line. + # kff todo: do some more XML munging here, on the header + # part of the entry: + my ($ignore,$min,$hour,$mday,$mon,$year,$wday) + = $UTC_Times ? gmtime($time) : localtime($time); + + # XML output includes everything else, we might as well make + # it always include Day Of Week too, for consistency. + if ($Show_Day_Of_Week or $XML_Output) { + $wday = ("Sunday", "Monday", "Tuesday", "Wednesday", + "Thursday", "Friday", "Saturday")[$wday]; + $wday = ($XML_Output) ? "${wday}\n" : " $wday"; + } + else { + $wday = ""; + } + + if ($XML_Output) { + $header_line = + sprintf ("%4u-%02u-%02u\n" + . "${wday}" + . "\n" + . "%s\n", + $year+1900, $mon+1, $mday, $hour, $min, $author); + } + else { + $header_line = + sprintf ("%4u-%02u-%02u${wday} %02u:%02u %s\n\n", + $year+1900, $mon+1, $mday, $hour, $min, $author); + } + + # Reshape the body according to user preferences. + if ($XML_Output) + { + $msg = &preprocess_msg_text ($msg); + $body = $files . $msg; + } + elsif ($No_Wrap) + { + $msg = &preprocess_msg_text ($msg); + $files = wrap ("\t", " ", "$files"); + $msg =~ s/\n(.*)/\n\t$1/g; + unless ($After_Header eq " ") { + $msg =~ s/^(.*)/\t$1/g; + } + $body = $files . $After_Header . $msg; + } + else # do wrapping, either FSF-style or regular + { + if ($FSF_Style) + { + $files = wrap ("\t", " ", "$files"); + + my $files_last_line_len = 0; + if ($After_Header eq " ") + { + $files_last_line_len = &last_line_len ($files); + $files_last_line_len += 1; # for $After_Header + } + + $msg = &wrap_log_entry + ($msg, "\t", 69 - $files_last_line_len, 69); + $body = $files . $After_Header . $msg; + } + else # not FSF-style + { + $msg = &preprocess_msg_text ($msg); + $body = $files . $After_Header . $msg; + $body = wrap ("\t", " ", "$body"); + } + } + + $wholething = $header_line . $body; + + if ($XML_Output) { + $wholething = "\n${wholething}\n"; + } + + # One last check: make sure it passes the regexp test, if the + # user asked for that. We have to do it here, so that the + # test can match against information in the header as well + # as in the text of the log message. + + # How annoying to duplicate so much code just because I + # can't figure out a way to evaluate scalars on the trailing + # operator portion of a regular expression. Grrr. + if ($Case_Insensitive) { + unless ($Regexp_Gate && ($wholething !~ /$Regexp_Gate/oi)) { + print LOG_OUT "${wholething}\n"; + } + } + else { + unless ($Regexp_Gate && ($wholething !~ /$Regexp_Gate/o)) { + print LOG_OUT "${wholething}\n"; + } + } + } + } + } + + if ($XML_Output) { + print LOG_OUT "\n"; + } + + close (LOG_OUT); + + if (! $Output_To_Stdout) + { + if (-f $logfile_here) { + rename ($logfile_here, $logfile_bak); + } + rename ($tmpfile, $logfile_here); + } + } +} + + +sub parse_date_and_author () +{ + # Parses the date/time and author out of a line like: + # + # date: 1999/02/19 23:29:05; author: apharris; state: Exp; + + my $line = shift; + + my ($year, $mon, $mday, $hours, $min, $secs, $author) = $line =~ + m#(\d+)/(\d+)/(\d+)\s+(\d+):(\d+):(\d+);\s+author:\s+([^;]+);# + or die "Couldn't parse date ``$line''"; + die "Bad date or Y2K issues" unless ($year > 1969 and $year < 2258); + # Kinda arbitrary, but useful as a sanity check + my $time = timegm($secs,$min,$hours,$mday,$mon-1,$year-1900); + + return ($time, $author); +} + + +# Here we take a bunch of qunks and convert them into printed +# summary that will include all the information the user asked for. +sub pretty_file_list () +{ + if ($Hide_Filenames and (! $XML_Output)) { + return ""; + } + + my $qunksref = shift; + my @qunkrefs = @$qunksref; + my @filenames; + my $beauty = ""; # The accumulating header string for this entry. + my %non_unanimous_tags; # Tags found in a proper subset of qunks + my %unanimous_tags; # Tags found in all qunks + my %all_branches; # Branches found in any qunk + my $common_dir = undef; # Dir prefix common to all files ("" if none) + my $fbegun = 0; # Did we begin printing filenames yet? + + # First, loop over the qunks gathering all the tag/branch names. + # We'll put them all in non_unanimous_tags, and take out the + # unanimous ones later. + foreach my $qunkref (@qunkrefs) + { + # Keep track of whether all the files in this commit were in the + # same directory, and memorize it if so. We can make the output a + # little more compact by mentioning the directory only once. + if ((scalar (@qunkrefs)) > 1) + { + if (! (defined ($common_dir))) + { + my ($base, $dir); + ($base, $dir, undef) = fileparse ($$qunkref{'filename'}); + + if ((! (defined ($dir))) # this first case is sheer paranoia + or ($dir eq "") + or ($dir eq "./") + or ($dir eq ".\\")) + { + $common_dir = ""; + } + else + { + $common_dir = $dir; + } + } + elsif ($common_dir ne "") + { + # Already have a common dir prefix, so how much of it can we preserve? + $common_dir = &common_path_prefix ($$qunkref{'filename'}, $common_dir); + } + } + else # only one file in this entry anyway, so common dir not an issue + { + $common_dir = ""; + } + + if (defined ($$qunkref{'branch'})) { + $all_branches{$$qunkref{'branch'}} = 1; + } + if (defined ($$qunkref{'tags'})) { + foreach my $tag (@{$$qunkref{'tags'}}) { + $non_unanimous_tags{$tag} = 1; + } + } + } + + # Any tag held by all qunks will be printed specially... but only if + # there are multiple qunks in the first place! + if ((scalar (@qunkrefs)) > 1) { + foreach my $tag (keys (%non_unanimous_tags)) { + my $everyone_has_this_tag = 1; + foreach my $qunkref (@qunkrefs) { + if ((! (defined ($$qunkref{'tags'}))) + or (! (grep ($_ eq $tag, @{$$qunkref{'tags'}})))) { + $everyone_has_this_tag = 0; + } + } + if ($everyone_has_this_tag) { + $unanimous_tags{$tag} = 1; + delete $non_unanimous_tags{$tag}; + } + } + } + + if ($XML_Output) + { + # If outputting XML, then our task is pretty simple, because we + # don't have to detect common dir, common tags, branch prefixing, + # etc. We just output exactly what we have, and don't worry about + # redundancy or readability. + + foreach my $qunkref (@qunkrefs) + { + my $filename = $$qunkref{'filename'}; + my $revision = $$qunkref{'revision'}; + my $tags = $$qunkref{'tags'}; + my $branch = $$qunkref{'branch'}; + my $branchroots = $$qunkref{'branchroots'}; + + $filename = &xml_escape ($filename); # probably paranoia + $revision = &xml_escape ($revision); # definitely paranoia + + $beauty .= "\n"; + $beauty .= "${filename}\n"; + $beauty .= "${revision}\n"; + if ($branch) { + $branch = &xml_escape ($branch); # more paranoia + $beauty .= "${branch}\n"; + } + foreach my $tag (@$tags) { + $tag = &xml_escape ($tag); # by now you're used to the paranoia + $beauty .= "${tag}\n"; + } + foreach my $root (@$branchroots) { + $root = &xml_escape ($root); # which is good, because it will continue + $beauty .= "${root}\n"; + } + $beauty .= "\n"; + } + + # Theoretically, we could go home now. But as long as we're here, + # let's print out the common_dir and utags, as a convenience to + # the receiver (after all, earlier code calculated that stuff + # anyway, so we might as well take advantage of it). + + if ((scalar (keys (%unanimous_tags))) > 1) { + foreach my $utag ((keys (%unanimous_tags))) { + $utag = &xml_escape ($utag); # the usual paranoia + $beauty .= "${utag}\n"; + } + } + if ($common_dir) { + $common_dir = &xml_escape ($common_dir); + $beauty .= "${common_dir}\n"; + } + + # That's enough for XML, time to go home: + return $beauty; + } + + # Else not XML output, so complexly compactify for chordate + # consumption. At this point we have enough global information + # about all the qunks to organize them non-redundantly for output. + + if ($common_dir) { + # Note that $common_dir still has its trailing slash + $beauty .= "$common_dir: "; + } + + if ($Show_Branches) + { + # For trailing revision numbers. + my @brevisions; + + foreach my $branch (keys (%all_branches)) + { + foreach my $qunkref (@qunkrefs) + { + if ((defined ($$qunkref{'branch'})) + and ($$qunkref{'branch'} eq $branch)) + { + if ($fbegun) { + # kff todo: comma-delimited in XML too? Sure. + $beauty .= ", "; + } + else { + $fbegun = 1; + } + my $fname = substr ($$qunkref{'filename'}, length ($common_dir)); + $beauty .= $fname; + $$qunkref{'printed'} = 1; # Just setting a mark bit, basically + + if ($Show_Tags && (defined @{$$qunkref{'tags'}})) { + my @tags = grep ($non_unanimous_tags{$_}, @{$$qunkref{'tags'}}); + if (@tags) { + $beauty .= " (tags: "; + $beauty .= join (', ', @tags); + $beauty .= ")"; + } + } + + if ($Show_Revisions) { + # Collect the revision numbers' last components, but don't + # print them -- they'll get printed with the branch name + # later. + $$qunkref{'revision'} =~ /.+\.([\d]+)$/; + push (@brevisions, $1); + + # todo: we're still collecting branch roots, but we're not + # showing them anywhere. If we do show them, it would be + # nifty to just call them revision "0" on a the branch. + # Yeah, that's the ticket. + } + } + } + $beauty .= " ($branch"; + if (@brevisions) { + if ((scalar (@brevisions)) > 1) { + $beauty .= ".["; + $beauty .= (join (',', @brevisions)); + $beauty .= "]"; + } + else { + $beauty .= ".$brevisions[0]"; + } + } + $beauty .= ")"; + } + } + + # Okay; any qunks that were done according to branch are taken care + # of, and marked as printed. Now print everyone else. + + foreach my $qunkref (@qunkrefs) + { + next if (defined ($$qunkref{'printed'})); # skip if already printed + + if ($fbegun) { + $beauty .= ", "; + } + else { + $fbegun = 1; + } + $beauty .= substr ($$qunkref{'filename'}, length ($common_dir)); + # todo: Shlomo's change was this: + # $beauty .= substr ($$qunkref{'filename'}, + # (($common_dir eq "./") ? "" : length ($common_dir))); + $$qunkref{'printed'} = 1; # Set a mark bit. + + if ($Show_Revisions || $Show_Tags) + { + my $started_addendum = 0; + + if ($Show_Revisions) { + $started_addendum = 1; + $beauty .= " ("; + $beauty .= "$$qunkref{'revision'}"; + } + if ($Show_Tags && (defined $$qunkref{'tags'})) { + my @tags = grep ($non_unanimous_tags{$_}, @{$$qunkref{'tags'}}); + if ((scalar (@tags)) > 0) { + if ($started_addendum) { + $beauty .= ", "; + } + else { + $beauty .= " (tags: "; + } + $beauty .= join (', ', @tags); + $started_addendum = 1; + } + } + if ($started_addendum) { + $beauty .= ")"; + } + } + } + + # Unanimous tags always come last. + if ($Show_Tags && %unanimous_tags) + { + $beauty .= " (utags: "; + $beauty .= join (', ', keys (%unanimous_tags)); + $beauty .= ")"; + } + + # todo: still have to take care of branch_roots? + + $beauty = "* $beauty:"; + + return $beauty; +} + + +sub common_path_prefix () +{ + my $path1 = shift; + my $path2 = shift; + + my ($dir1, $dir2); + (undef, $dir1, undef) = fileparse ($path1); + (undef, $dir2, undef) = fileparse ($path2); + + # Transmogrify Windows filenames to look like Unix. + # (It is far more likely that someone is running cvs2cl.pl under + # Windows than that they would genuinely have backslashes in their + # filenames.) + $dir1 =~ tr#\\#/#; + $dir2 =~ tr#\\#/#; + + my $accum1 = ""; + my $accum2 = ""; + my $last_common_prefix = ""; + + while ($accum1 eq $accum2) + { + $last_common_prefix = $accum1; + last if ($accum1 eq $dir1); + my ($tmp1) = split (/\//, (substr ($dir1, length ($accum1)))); + my ($tmp2) = split (/\//, (substr ($dir2, length ($accum2)))); + $accum1 .= "$tmp1/" if ((defined ($tmp1)) and $tmp1); + $accum2 .= "$tmp2/" if ((defined ($tmp2)) and $tmp2); + } + + return $last_common_prefix; +} + + +sub preprocess_msg_text () +{ + my $text = shift; + + # Strip out carriage returns (as they probably result from DOSsy editors). + $text =~ s/\r\n/\n/g; + + # If it *looks* like two newlines, make it *be* two newlines: + $text =~ s/\n\s*\n/\n\n/g; + + if ($XML_Output) + { + $text = &xml_escape ($text); + $text = "${text}\n"; + } + elsif (! $No_Wrap) + { + # Strip off lone newlines, but only for lines that don't begin with + # whitespace or a mail-quoting character, since we want to preserve + # that kind of formatting. Also don't strip newlines that follow a + # period; we handle those specially next. And don't strip + # newlines that precede an open paren. + 1 while ($text =~ s/(^|\n)([^>\s].*[^.\n])\n([^>\n])/$1$2 $3/g); + + # If a newline follows a period, make sure that when we bring up the + # bottom sentence, it begins with two spaces. + 1 while ($text =~ s/(^|\n)([^>\s].*)\n([^>\n])/$1$2 $3/g); + } + + return $text; +} + + +sub last_line_len () +{ + my $files_list = shift; + my @lines = split (/\n/, $files_list); + my $last_line = pop (@lines); + return length ($last_line); +} + + +# A custom wrap function, sensitive to some common constructs used in +# log entries. +sub wrap_log_entry () +{ + my $text = shift; # The text to wrap. + my $left_pad_str = shift; # String to pad with on the left. + + # These do NOT take left_pad_str into account: + my $length_remaining = shift; # Amount left on current line. + my $max_line_length = shift; # Amount left for a blank line. + + my $wrapped_text = ""; # The accumulating wrapped entry. + my $user_indent = ""; # Inherited user_indent from prev line. + + my $first_time = 1; # First iteration of the loop? + my $suppress_line_start_match = 0; # Set to disable line start checks. + + my @lines = split (/\n/, $text); + while (@lines) # Don't use `foreach' here, it won't work. + { + my $this_line = shift (@lines); + chomp $this_line; + + if ($this_line =~ /^(\s+)/) { + $user_indent = $1; + } + else { + $user_indent = ""; + } + + # If it matches any of the line-start regexps, print a newline now... + if ($suppress_line_start_match) + { + $suppress_line_start_match = 0; + } + elsif (($this_line =~ /^(\s*)\*\s+[a-zA-Z0-9]/) + || ($this_line =~ /^(\s*)\* [a-zA-Z0-9_\.\/\+-]+/) + || ($this_line =~ /^(\s*)\([a-zA-Z0-9_\.\/\+-]+(\)|,\s*)/) + || ($this_line =~ /^(\s+)(\S+)/) + || ($this_line =~ /^(\s*)- +/) + || ($this_line =~ /^()\s*$/) + || ($this_line =~ /^(\s*)\*\) +/) + || ($this_line =~ /^(\s*)[a-zA-Z0-9](\)|\.|\:) +/)) + { + # Make a line break immediately, unless header separator is set + # and this line is the first line in the entry, in which case + # we're getting the blank line for free already and shouldn't + # add an extra one. + unless (($After_Header ne " ") and ($first_time)) + { + if ($this_line =~ /^()\s*$/) { + $suppress_line_start_match = 1; + $wrapped_text .= "\n${left_pad_str}"; + } + + $wrapped_text .= "\n${left_pad_str}"; + } + + $length_remaining = $max_line_length - (length ($user_indent)); + } + + # Now that any user_indent has been preserved, strip off leading + # whitespace, so up-folding has no ugly side-effects. + $this_line =~ s/^\s*//; + + # Accumulate the line, and adjust parameters for next line. + my $this_len = length ($this_line); + if ($this_len == 0) + { + # Blank lines should cancel any user_indent level. + $user_indent = ""; + $length_remaining = $max_line_length; + } + elsif ($this_len >= $length_remaining) # Line too long, try breaking it. + { + # Walk backwards from the end. At first acceptable spot, break + # a new line. + my $idx = $length_remaining - 1; + if ($idx < 0) { $idx = 0 }; + while ($idx > 0) + { + if (substr ($this_line, $idx, 1) =~ /\s/) + { + my $line_now = substr ($this_line, 0, $idx); + my $next_line = substr ($this_line, $idx); + $this_line = $line_now; + + # Clean whitespace off the end. + chomp $this_line; + + # The current line is ready to be printed. + $this_line .= "\n${left_pad_str}"; + + # Make sure the next line is allowed full room. + $length_remaining = $max_line_length - (length ($user_indent)); + + # Strip next_line, but then preserve any user_indent. + $next_line =~ s/^\s*//; + + # Sneak a peek at the user_indent of the upcoming line, so + # $next_line (which will now precede it) can inherit that + # indent level. Otherwise, use whatever user_indent level + # we currently have, which might be none. + my $next_next_line = shift (@lines); + if ((defined ($next_next_line)) && ($next_next_line =~ /^(\s+)/)) { + $next_line = $1 . $next_line if (defined ($1)); + # $length_remaining = $max_line_length - (length ($1)); + $next_next_line =~ s/^\s*//; + } + else { + $next_line = $user_indent . $next_line; + } + if (defined ($next_next_line)) { + unshift (@lines, $next_next_line); + } + unshift (@lines, $next_line); + + # Our new next line might, coincidentally, begin with one of + # the line-start regexps, so we temporarily turn off + # sensitivity to that until we're past the line. + $suppress_line_start_match = 1; + + last; + } + else + { + $idx--; + } + } + + if ($idx == 0) + { + # We bottomed out because the line is longer than the + # available space. But that could be because the space is + # small, or because the line is longer than even the maximum + # possible space. Handle both cases below. + + if ($length_remaining == ($max_line_length - (length ($user_indent)))) + { + # The line is simply too long -- there is no hope of ever + # breaking it nicely, so just insert it verbatim, with + # appropriate padding. + $this_line = "\n${left_pad_str}${this_line}"; + } + else + { + # Can't break it here, but may be able to on the next round... + unshift (@lines, $this_line); + $length_remaining = $max_line_length - (length ($user_indent)); + $this_line = "\n${left_pad_str}"; + } + } + } + else # $this_len < $length_remaining, so tack on what we can. + { + # Leave a note for the next iteration. + $length_remaining = $length_remaining - $this_len; + + if ($this_line =~ /\.$/) + { + $this_line .= " "; + $length_remaining -= 2; + } + else # not a sentence end + { + $this_line .= " "; + $length_remaining -= 1; + } + } + + # Unconditionally indicate that loop has run at least once. + $first_time = 0; + + $wrapped_text .= "${user_indent}${this_line}"; + } + + # One last bit of padding. + $wrapped_text .= "\n"; + + return $wrapped_text; +} + + +sub xml_escape () +{ + my $txt = shift; + $txt =~ s/&/&/g; + $txt =~ s//>/g; + return $txt; +} + + +sub maybe_read_user_map_file () +{ + my %expansions; + + if ($User_Map_File) + { + open (MAPFILE, "<$User_Map_File") + or die ("Unable to open $User_Map_File ($!)"); + + while () + { + next if /^\s*#/; # Skip comment lines. + next if not /:/; # Skip lines without colons. + + # It is now safe to split on ':'. + my ($username, $expansion) = split ':'; + chomp $expansion; + $expansion =~ s/^'(.*)'$/$1/; + $expansion =~ s/^"(.*)"$/$1/; + + # If it looks like the expansion has a real name already, then + # we toss the username we got from CVS log. Otherwise, keep + # it to use in combination with the email address. + + if ($expansion =~ /^\s*<{0,1}\S+@.*/) { + # Also, add angle brackets if none present + if (! ($expansion =~ /<\S+@\S+>/)) { + $expansions{$username} = "$username <$expansion>"; + } + else { + $expansions{$username} = "$username $expansion"; + } + } + else { + $expansions{$username} = $expansion; + } + } + + close (MAPFILE); + } + + return %expansions; +} + + +sub parse_options () +{ + # Check this internally before setting the global variable. + my $output_file; + + # If this gets set, we encountered unknown options and will exit at + # the end of this subroutine. + my $exit_with_admonishment = 0; + + while (my $arg = shift (@ARGV)) + { + if ($arg =~ /^-h$|^-help$|^--help$|^--usage$|^-?$/) { + $Print_Usage = 1; + } + elsif ($arg =~ /^--debug$/) { # unadvertised option, heh + $Debug = 1; + } + elsif ($arg =~ /^--version$/) { + $Print_Version = 1; + } + elsif ($arg =~ /^-g$|^--global-opts$/) { + my $narg = shift (@ARGV) || die "$arg needs argument.\n"; + # Don't assume CVS is called "cvs" on the user's system: + $Log_Source_Command =~ s/(^\S*)/$1 $narg/; + } + elsif ($arg =~ /^-l$|^--log-opts$/) { + my $narg = shift (@ARGV) || die "$arg needs argument.\n"; + $Log_Source_Command .= " $narg"; + } + elsif ($arg =~ /^-f$|^--file$/) { + my $narg = shift (@ARGV) || die "$arg needs argument.\n"; + $output_file = $narg; + } + elsif ($arg =~ /^--fsf$/) { + $FSF_Style = 1; + } + elsif ($arg =~ /^-U$|^--usermap$/) { + my $narg = shift (@ARGV) || die "$arg needs argument.\n"; + $User_Map_File = $narg; + } + elsif ($arg =~ /^-W$|^--window$/) { + my $narg = shift (@ARGV) || die "$arg needs argument.\n"; + $Max_Checkin_Duration = $narg; + } + elsif ($arg =~ /^-I$|^--ignore$/) { + my $narg = shift (@ARGV) || die "$arg needs argument.\n"; + push (@Ignore_Files, $narg); + } + elsif ($arg =~ /^-C$|^--case-insensitive$/) { + $Case_Insensitive = 1; + } + elsif ($arg =~ /^-R$|^--regexp$/) { + my $narg = shift (@ARGV) || die "$arg needs argument.\n"; + $Regexp_Gate = $narg; + } + elsif ($arg =~ /^--stdout$/) { + $Output_To_Stdout = 1; + } + elsif ($arg =~ /^--version$/) { + $Print_Version = 1; + } + elsif ($arg =~ /^-d$|^--distributed$/) { + $Distributed = 1; + } + elsif ($arg =~ /^-P$|^--prune$/) { + $Prune_Empty_Msgs = 1; + } + elsif ($arg =~ /^-S$|^--separate-header$/) { + $After_Header = "\n\n"; + } + elsif ($arg =~ /^--no-wrap$/) { + $No_Wrap = 1; + } + elsif ($arg =~ /^--gmt$|^--utc$/) { + $UTC_Times = 1; + } + elsif ($arg =~ /^-w$|^--day-of-week$/) { + $Show_Day_Of_Week = 1; + } + elsif ($arg =~ /^-r$|^--revisions$/) { + $Show_Revisions = 1; + } + elsif ($arg =~ /^-t$|^--tags$/) { + $Show_Tags = 1; + } + elsif ($arg =~ /^-b$|^--branches$/) { + $Show_Branches = 1; + } + elsif ($arg =~ /^-F$|^--follow$/) { + my $narg = shift (@ARGV) || die "$arg needs argument.\n"; + push (@Follow_Branches, $narg); + } + elsif ($arg =~ /^--stdin$/) { + $Input_From_Stdin = 1; + } + elsif ($arg =~ /^--header$/) { + my $narg = shift (@ARGV) || die "$arg needs argument.\n"; + $ChangeLog_Header = &slurp_file ($narg); + if (! defined ($ChangeLog_Header)) { + $ChangeLog_Header = ""; + } + } + elsif ($arg =~ /^--xml$/) { + $XML_Output = 1; + } + elsif ($arg =~ /^--hide-filenames$/) { + $Hide_Filenames = 1; + $After_Header = ""; + } + else { + # Just add a filename as argument to the log command + $Log_Source_Command .= " $arg"; + } + } + + ## Check for contradictions... + + if ($Output_To_Stdout && $Distributed) { + print STDERR "cannot pass both --stdout and --distributed\n"; + $exit_with_admonishment = 1; + } + + if ($Output_To_Stdout && $output_file) { + print STDERR "cannot pass both --stdout and --file\n"; + $exit_with_admonishment = 1; + } + + # Or if any other error message has already been printed out, we + # just leave now: + if ($exit_with_admonishment) { + &usage (); + exit (1); + } + elsif ($Print_Usage) { + &usage (); + exit (0); + } + elsif ($Print_Version) { + &version (); + exit (0); + } + + ## Else no problems, so proceed. + + if ($Output_To_Stdout) { + undef $Log_File_Name; # not actually necessary + } + elsif ($output_file) { + $Log_File_Name = $output_file; + } +} + + +sub slurp_file () +{ + my $filename = shift || die ("no filename passed to slurp_file()"); + my $retstr; + + open (SLURPEE, "<${filename}") or die ("unable to open $filename ($!)"); + my $saved_sep = $/; + undef $/; + $retstr = ; + $/ = $saved_sep; + close (SLURPEE); + return $retstr; +} + + +sub debug () +{ + if ($Debug) { + my $msg = shift; + print STDERR $msg; + } +} + + +sub version () +{ + print "cvs2cl.pl version ${VERSION}; distributed under the GNU GPL.\n"; +} + + +sub usage () +{ + &version (); + print <<'END_OF_INFO'; +Generate GNU-style ChangeLogs in CVS working copies. + +Notes about the output format(s): + + The default output of cvs2cl.pl is designed to be compact, formally + unambiguous, but still easy for humans to read. It is largely + self-explanatory, I hope; the one abbreviation that might not be + obvious is "utags". That stands for "universal tags" -- a + universal tag is one held by all the files in a given change entry. + + If you need output that's easy for a program to parse, use the + --xml option. Note that with XML output, just about all available + information is included with each change entry, whether you asked + for it or not, on the theory that your parser can ignore anything + it's not looking for. + +Notes about the options and arguments (the actual options are listed +last in this usage message): + + * The -I and -F options may appear multiple times. + + * To follow trunk revisions, use "-F trunk" ("-F TRUNK" also works). + This is okay because no would ever, ever be crazy enough to name a + branch "trunk", right? Right. + + * For the -U option, the UFILE should be formatted like + CVSROOT/users. That is, each line of UFILE looks like this + jrandom:jrandom@red-bean.com + or maybe even like this + jrandom:'Jesse Q. Random ' + Don't forget to quote the portion after the colon if necessary. + + * Many people want to filter by date. To do so, invoke cvs2cl.pl + like this: + cvs2cl.pl -l "-d'DATESPEC'" + where DATESPEC is any date specification valid for "cvs log -d". + (Note that CVS 1.10.7 and below requires there be no space between + -d and its argument). + +Options/Arguments: + + -h, -help, --help, or -? Show this usage and exit + --version Show version and exit + -r, --revisions Show revision numbers in output + -b, --branches Show branch names in revisions when possible + -t, --tags Show tags (symbolic names) in output + --stdin Read from stdin, don't run cvs log + --stdout Output to stdout not to ChangeLog + -d, --distributed Put ChangeLogs in subdirs + -f FILE, --file FILE Write to FILE instead of "ChangeLog" + --fsf Use this if log data is in FSF ChangeLog style + -W SECS, --window SECS Window of time within which log entries unify + -U UFILE, --usermap UFILE Expand usernames to email addresses from UFILE + -R REGEXP, --regexp REGEXP Include only entries that match REGEXP + -I REGEXP, --ignore REGEXP Ignore files whose names match REGEXP + -C, --case-insensitive Any regexp matching is done case-insensitively + -F BRANCH, --follow BRANCH Show only revisions on or ancestral to BRANCH + -S, --separate-header Blank line between each header and log message + --no-wrap Don't auto-wrap log message (recommend -S also) + --gmt, --utc Show times in GMT/UTC instead of local time + -w, --day-of-week Show day of week + --header FILE Get ChangeLog header from FILE ("-" means stdin) + --xml Output XML instead of ChangeLog format + --hide-filenames Don't show filenames (ignored for XML output) + -P, --prune Don't show empty log messages + -g OPTS, --global-opts OPTS Invoke like this "cvs OPTS log ..." + -l OPTS, --log-opts OPTS Invoke like this "cvs ... log OPTS" + FILE1 [FILE2 ...] Show only log information for the named FILE(s) + +See http://www.red-bean.com/cvs2cl for maintenance and bug info. +END_OF_INFO +} + +__END__ + +=head1 NAME + +cvs2cl.pl - produces GNU-style ChangeLogs in CVS working copies, by + running "cvs log" and parsing the output. Shared log entries are + unified in an intuitive way. + +=head1 DESCRIPTION + +This script generates GNU-style ChangeLog files from CVS log +information. Basic usage: just run it inside a working copy and a +ChangeLog will appear. It requires repository access (i.e., 'cvs log' +must work). Run "cvs2cl.pl --help" to see more advanced options. + +See http://www.red-bean.com/cvs2cl for updates, and for instructions +on getting anonymous CVS access to this script. + +Maintainer: Karl Fogel +Please report bugs to . + +=head1 README + +This script generates GNU-style ChangeLog files from CVS log +information. Basic usage: just run it inside a working copy and a +ChangeLog will appear. It requires repository access (i.e., 'cvs log' +must work). Run "cvs2cl.pl --help" to see more advanced options. + +See http://www.red-bean.com/cvs2cl for updates, and for instructions +on getting anonymous CVS access to this script. + +Maintainer: Karl Fogel +Please report bugs to . + +=head1 PREREQUISITES + +This script requires C, C, and +C. +It also seems to require C or higher. + +=pod OSNAMES + +any + +=pod SCRIPT CATEGORIES + +Version_Control/CVS + +=cut + + +-*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- + +Note about a bug-slash-opportunity: +----------------------------------- + +There's a bug in Text::Wrap, which affects cvs2cl. This script +reveals it: + + #!/usr/bin/perl -w + + use Text::Wrap; + + my $test_text = + "This script demonstrates a bug in Text::Wrap. The very long line + following this paragraph will be relocated relative to the surrounding + text: + + ==================================================================== + + See? When the bug happens, we'll get the line of equal signs below + this paragraph, even though it should be above."; + + + # Print out the test text with no wrapping: + print "$test_text"; + print "\n"; + print "\n"; + + # Now print it out wrapped, and see the bug: + print wrap ("\t", " ", "$test_text"); + print "\n"; + print "\n"; + +If the line of equal signs were one shorter, then the bug doesn't +happen. Interesting. + +Anyway, rather than fix this in Text::Wrap, we might as well write a +new wrap() which has the following much-needed features: + +* initial indentation, like current Text::Wrap() +* subsequent line indentation, like current Text::Wrap() +* user chooses among: force-break long words, leave them alone, or die()? +* preserve existing indentation: chopped chunks from an indented line + are indented by same (like this line, not counting the asterisk!) +* optional list of things to preserve on line starts, default ">" + +Note that the last two are essentially the same concept, so unify in +implementation and give a good interface to controlling them. + +And how about: + +Optionally, when encounter a line pre-indented by same as previous +line, then strip the newline and refill, but indent by the same. +Yeah... diff --git a/unused/Makefile.am b/unused/Makefile.am new file mode 100644 index 00000000..d5d77a92 --- /dev/null +++ b/unused/Makefile.am @@ -0,0 +1,4 @@ +SUBDIRS = bios lib novga pa_null ui vga win95 + +EXTRA_DIST = \ +readme.txt diff --git a/unused/bios/Makefile.am b/unused/bios/Makefile.am new file mode 100644 index 00000000..186c797c --- /dev/null +++ b/unused/bios/Makefile.am @@ -0,0 +1,10 @@ +EXTRA_DIST = \ +x rbaudio.new \ +d.bat dd.bat make0000.bat make0001.bat make0100.bat x.bat y.bat \ +testk.lnk testm.lnk \ +keys.inc \ +joy.asm key.asm mouse.asm oldkey.asm timer.asm \ +dpmi.h error.h findfile.h ipx.h joy.h key.h mouse.h \ +rbaudio.h swiftcfg.h timer.h \ +dpmi.c error.c findfile.c ipx.c joyc.c key.c mono.c mouse.c \ +rbaudio.c speaker.c testj.c testk.c testm.c testms.c testt.c timerp.c x.c diff --git a/unused/lib/Makefile.am b/unused/lib/Makefile.am new file mode 100644 index 00000000..7e25cd14 --- /dev/null +++ b/unused/lib/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ +fix.h rbaudio.h diff --git a/unused/novga/Makefile.am b/unused/novga/Makefile.am new file mode 100644 index 00000000..428515c3 --- /dev/null +++ b/unused/novga/Makefile.am @@ -0,0 +1,3 @@ +EXTRA_DIST = \ +files.rc \ +novesa.c diff --git a/unused/pa_null/Makefile.am b/unused/pa_null/Makefile.am new file mode 100644 index 00000000..43ce75ef --- /dev/null +++ b/unused/pa_null/Makefile.am @@ -0,0 +1,3 @@ +EXTRA_DIST = \ +pa_enabl.h poly_acc.h \ +poly_acc.c diff --git a/unused/ui/Makefile.am b/unused/ui/Makefile.am new file mode 100644 index 00000000..82ab10a3 --- /dev/null +++ b/unused/ui/Makefile.am @@ -0,0 +1,6 @@ +EXTRA_DIST = \ +func.h ui.h \ +barbox.c button.c checkbox.c file.c func.c gadget.c harderr.c icon.c \ +inputbox.c keypad.c keypress.c keytrap.c listbox.c medfunc.c menu.c \ +menubar.c message.c mouse.c number.c popup.c radio.c scroll.c ui.c \ +uidraw.c userbox.c window.c diff --git a/unused/vga/Makefile.am b/unused/vga/Makefile.am new file mode 100644 index 00000000..7afd6caa --- /dev/null +++ b/unused/vga/Makefile.am @@ -0,0 +1,9 @@ +SUBDIRS = new + +EXTRA_DIST = \ +dd.bat xyz.bat \ +framebuf.jas vga.jas \ +tweak.inc vgaregs.inc \ +modex.asm vesa.asm \ +fxdpmi.h fxvesa.h grx.h vga.h \ +framebuf.c palette.c vga.c diff --git a/unused/vga/new/Makefile.am b/unused/vga/new/Makefile.am new file mode 100644 index 00000000..9f797584 --- /dev/null +++ b/unused/vga/new/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ +palette.c vga.c diff --git a/unused/win95/Makefile.am b/unused/win95/Makefile.am new file mode 100644 index 00000000..91b2f243 --- /dev/null +++ b/unused/win95/Makefile.am @@ -0,0 +1,8 @@ +EXTRA_DIST = \ +dd.bat \ +winckpit.asm \ +comm.h dd.h direct3d.h ds.h error.h global.h iforce.h midifile.h midiseq.h \ +tactile.h winapp.h winmidi.h winregs.h xtapi.h \ +comm.c dd.c ddgfx.c ddgr.c ddraw.c direct3d.c ds.c error.c gfx.c \ +iforce.c ipx.c joyc.c key.c mono.c mouse.c palette.c rbaudio.c swift.c \ +tactile.c timer.c winapp.c winmidi.c winmono.c winregs.c xtapi.c diff --git a/video/Makefile.am b/video/Makefile.am index 0cba3d18..8889686a 100644 --- a/video/Makefile.am +++ b/video/Makefile.am @@ -1,4 +1,28 @@ noinst_LIBRARIES = libvideo.a -INCLUDES = -I $(top_srcdir) -I$(top_srcdir)/includes -I$(top_srcdir)/main -I../input/ggi/include -libvideo_a_SOURCES = ogl.c ogl_glx.c ogl_gr.c \ -sdl_gr.c dos_gr.c + +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/includes -I$(top_srcdir)/main -I$(top_srcdir)/arch/include + +if ENV_DJGPP +libvideo_a_SOURCES = dos_gr.c +else +if USE_OPENGL +libvideo_a_SOURCES = ogl_gr.c ogl.c ogl_sdl.c +else +if USE_GGI +libvideo_a_SOURCES = ggi_gr.c +else +if USE_SVGALIB +libvideo_a_SOURCES = svgalib_gr.c +else +libvideo_a_SOURCES = sdl_gr.c +endif +endif +endif +endif + +EXTRA_libvideo_a_SOURCES = \ +dos_gr.c ogl_gr.c ogl.c ogl_sdl.c ggi_gr.c svgalib_gr.c sdl_gr.c + +# Not currently used +EXTRA_DIST = \ +ogl_wgl.c ogl_glx.c diff --git a/video/Makefile.in b/video/Makefile.in deleted file mode 100644 index bcd2176f..00000000 --- a/video/Makefile.in +++ /dev/null @@ -1,300 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# 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. - -# 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. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CFLAGS = @CFLAGS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NASM = @NASM@ -NASMFLAGS = @NASMFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -SDL_LIBS = @SDL_LIBS@ -VERSION = @VERSION@ - -noinst_LIBRARIES = libvideo.a -INCLUDES = -I $(top_srcdir) -I$(top_srcdir)/includes -I$(top_srcdir)/main -I../input/ggi/include -libvideo_a_SOURCES = ogl.c ogl_glx.c ogl_gr.c sdl_gr.c dos_gr.c - -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../conf.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I.. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -libvideo_a_LIBADD = -libvideo_a_OBJECTS = ogl.o ogl_glx.o ogl_gr.o sdl_gr.o dos_gr.o -AR = ar -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -DEP_FILES = .deps/dos_gr.P .deps/ogl.P .deps/ogl_glx.P .deps/ogl_gr.P \ -.deps/sdl_gr.P -SOURCES = $(libvideo_a_SOURCES) -OBJECTS = $(libvideo_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu video/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -.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: - -libvideo.a: $(libvideo_a_OBJECTS) $(libvideo_a_DEPENDENCIES) - -rm -f libvideo.a - $(AR) cru libvideo.a $(libvideo_a_OBJECTS) $(libvideo_a_LIBADD) - $(RANLIB) libvideo.a - -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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - 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 = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = video - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu video/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - 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 - @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 -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -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-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-depend mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - 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-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags 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 \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -# 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/video/dos_gr.c b/video/dos_gr.c index 1cffb330..72e24803 100644 --- a/video/dos_gr.c +++ b/video/dos_gr.c @@ -1,7 +1,17 @@ -// Graphics functions for DOS. - +/* + * $Source: /cvs/cvsroot/d2x/video/dos_gr.c,v $ + * $Revision: 1.2 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 13:47:51 $ + * + * Graphics functions for DOS. + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include -#ifdef __ENV_DJGPP__ +#endif #include #include @@ -723,6 +733,3 @@ void gr_palette_read(ubyte * palette) void gr_update(void) { } - - -#endif // __ENV_DJGPP__ diff --git a/video/ggi_gr.c b/video/ggi_gr.c index 38627e4d..c5486f95 100644 --- a/video/ggi_gr.c +++ b/video/ggi_gr.c @@ -1,3 +1,18 @@ +/* + * $Source: /cvs/cvsroot/d2x/video/ggi_gr.c,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 13:47:51 $ + * + * Graphics functions for GGI. + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -7,6 +22,7 @@ #include "palette.h" #include "u_mem.h" #include "error.h" +#include "console.h" #include "gamefont.h" @@ -15,6 +31,7 @@ void *screenbuffer; ggi_visual_t *screenvis; const ggi_directbuffer *dbuffer; +ggi_mode init_mode; ubyte use_directbuffer; @@ -28,7 +45,7 @@ void gr_update() int gr_set_mode(u_int32_t mode) { unsigned int w, h; - ggi_mode other_mode; + ggi_mode other_mode; #ifdef NOGRAPH return 0; @@ -87,14 +104,15 @@ int gr_set_mode(u_int32_t mode) gr_set_current_canvas(NULL); - gamefont_choose_game_font(w,h); + //gamefont_choose_game_font(w,h); return 0; } -int gr_init(int mode) +int gr_init(void) { int retcode; + int mode = SM(648,480); // Only do this function once! if (gr_installed==1) return -1; @@ -103,6 +121,7 @@ int gr_init(int mode) ggiInit(); screenvis = ggiOpen(NULL); + ggiGetMode(screenvis, &init_mode); if ((retcode=gr_set_mode(mode))) return retcode; @@ -123,6 +142,7 @@ void gr_close () { if (gr_installed==1) { + ggiSetMode(screenvis, &init_mode); ggiClose(screenvis); ggiExit(); gr_installed = 0; @@ -325,4 +345,3 @@ void gr_palette_read (ubyte *pal) pal[j++] = colors[i].b / 0x3ff; } } - diff --git a/video/ogl.c b/video/ogl.c index 31e2dab6..089e63e8 100644 --- a/video/ogl.c +++ b/video/ogl.c @@ -1,5 +1,29 @@ +/* + * $Source: /cvs/cvsroot/d2x/video/ogl.c,v $ + * $Revision: 1.7 $ + * $Author: bradleyb $ + * $Date: 2001-10-12 00:18:40 $ + * + * Graphics support functions for OpenGL. + * + * $Log: not supported by cvs2svn $ + * Revision 1.6 2001/10/09 03:00:08 bradleyb + * opengl improvments (following d1x changes) + * + * Revision 1.5 2001/10/09 02:38:52 bradleyb + * re-imported d1x version of this file + * + * Revision 1.4 2001/01/31 16:31:14 bradleyb + * OpenGL support under Cygwin/SDL + * + * Revision 1.3 2001/01/29 13:47:52 bradleyb + * Fixed build, some minor cleanups. + * + */ + +#ifdef HAVE_CONFIG_H #include -#ifdef OGL +#endif //#include #ifdef __WINDOWS__ @@ -10,6 +34,7 @@ #include #include #include + #include "ogl_init.h" #include "3d.h" #include "piggy.h" @@ -28,13 +53,20 @@ #include "powerup.h" #include "polyobj.h" #include "gamefont.h" +#include "grdef.h" +//change to 1 for lots of spew. +#if 0 +#define glmprintf(a) mprintf(a) +#else +#define glmprintf(a) +#endif #ifndef M_PI #define M_PI 3.14159 #endif -#ifdef __WINDOWS__ +#if defined(__WINDOWS__) || defined(__MINGW32__) #define cosf(a) cos(a) #define sinf(a) sin(a) #endif @@ -57,6 +89,13 @@ int ogl_intensity4_ok=1; int ogl_luminance4_alpha4_ok=1; int ogl_rgba2_ok=1; int ogl_readpixels_ok=1; +int ogl_gettexlevelparam_ok=1; +#ifdef GL_ARB_multitexture +int ogl_arb_multitexture_ok=0; +#endif +#ifdef GL_SGIS_multitexture +int ogl_sgis_multitexture_ok=0; +#endif int sphereh=0; int circleh5=0; @@ -110,7 +149,10 @@ void ogl_smash_texture_list_internal(void){ memset(primary_lh,0,sizeof(primary_lh)); memset(secondary_lh,0,sizeof(secondary_lh)); for (i=0;i0){ + glDeleteTextures( 1, &ogl_texture_list[i].handle ); + ogl_texture_list[i].handle=0; + } ogl_texture_list[i].wrapstate=-1; } } @@ -162,7 +204,7 @@ int ogl_texture_stats(void){ if (gr_renderstats){ gr_printf(5,GAME_FONT->ft_h*14+3*14,"%i(%i,%i) %iK(%iK wasted)",used,usedrgba,usedl4a4,truebytes/1024,(truebytes-databytes)/1024); } -// mprintf((0,"ogl tex stats: %i(%i,%i|%i,%i,%i,%i,%i) %i(%i)b (%i(%i)wasted)\n",used,usedrgba,usedl4a4,prio0,prio1,prio2,prio3,prioh,truebytes,truetexel,truebytes-databytes,truetexel-datatexel)); +// glmprintf((0,"ogl tex stats: %i(%i,%i|%i,%i,%i,%i,%i) %i(%i)b (%i(%i)wasted)\n",used,usedrgba,usedl4a4,prio0,prio1,prio2,prio3,prioh,truebytes,truetexel,truebytes-databytes,truetexel-datatexel)); return truebytes; } int ogl_mem_target=-1; @@ -202,11 +244,12 @@ void ogl_bindbmtex(grs_bitmap *bm){ OGL_BINDTEXTURE(bm->gltexture->handle); bm->gltexture->lastrend=GameTime; bm->gltexture->numrend++; - if (bm->gltexture->numrend==80 || bm->gltexture->numrend==4000 || bm->gltexture->numrend==80000){ - bm->gltexture->prio+=0.1; -// glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_PRIORITY,bm->gltexture->prio); - glPrioritizeTextures(1,&bm->gltexture->handle,&bm->gltexture->prio); - } +//// if (bm->gltexture->numrend==80 || bm->gltexture->numrend==4000 || bm->gltexture->numrend==80000){ +// if (bm->gltexture->numrend==100){ +// bm->gltexture->prio+=0.1; +//// glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_PRIORITY,bm->gltexture->prio); +// glPrioritizeTextures(1,&bm->gltexture->handle,&bm->gltexture->prio); +// } } //gltexture MUST be bound first void ogl_texwrap(ogl_texture *gltexture,int state){ @@ -264,7 +307,7 @@ void ogl_cache_level_textures(void){ if (ec->vc.num_frames>max_efx) max_efx=ec->vc.num_frames; } - mprintf((0,"max_efx:%i\n",max_efx)); + glmprintf((0,"max_efx:%i\n",max_efx)); for (ef=0;eftmap_num; tmap2=sidep->tmap_num2; if (tmap1<0 || tmap1>=NumTextures){ - mprintf((0,"ogl_cache_level_textures %i %i %i %i\n",seg,side,tmap1,NumTextures)); + glmprintf((0,"ogl_cache_level_textures %i %i %i %i\n",seg,side,tmap1,NumTextures)); // tmap1=0; continue; } @@ -295,12 +338,12 @@ void ogl_cache_level_textures(void){ else { ogl_loadbmtexture(bm2); } - // mprintf((0,"ogl_cache_level_textures seg %i side %i t1 %i t2 %x bm %p NT %i\n",seg,side,tmap1,tmap2,bm,NumTextures)); + // glmprintf((0,"ogl_cache_level_textures seg %i side %i t1 %i t2 %x bm %p NT %i\n",seg,side,tmap1,tmap2,bm,NumTextures)); } ogl_loadbmtexture(bm); } } - mprintf((0,"finished ef:%i\n",ef)); + glmprintf((0,"finished ef:%i\n",ef)); } reset_special_effects(); init_special_effects(); @@ -354,7 +397,7 @@ void ogl_cache_level_textures(void){ } } } - mprintf((0,"finished caching\n")); + glmprintf((0,"finished caching\n")); } int r_polyc,r_tpolyc,r_bitmapc,r_ubitmapc,r_ubitbltc,r_upixelc; @@ -501,20 +544,20 @@ void ogl_draw_reticle(int cross,int primary,int secondary){ glColor3fv(darker_g); else glColor3fv(bright_g); - ogl_drawcircle2(6,GL_LINE_LOOP,2.0,-10.0,2.0,-1.0); + ogl_drawcircle2(8,GL_LINE_LOOP,2.0,-10.0,2.0,-1.0); //right secondary if (secondary!=2) glColor3fv(darker_g); else glColor3fv(bright_g); - ogl_drawcircle2(6,GL_LINE_LOOP,2.0,10.0,2.0,-1.0); + ogl_drawcircle2(8,GL_LINE_LOOP,2.0,10.0,2.0,-1.0); }else{ //bottom/middle secondary if (secondary!=4) glColor3fv(darker_g); else glColor3fv(bright_g); - ogl_drawcircle2(6,GL_LINE_LOOP,2.0,0.0,2.0,-7.0); + ogl_drawcircle2(8,GL_LINE_LOOP,2.0,0.0,2.0,-7.0); } glEndList(); }else @@ -550,7 +593,7 @@ int gr_ucircle(fix xc1,fix yc1,fix r1){//dunno if this really works, radar doesn // glVertex3f(f2glf(pnt->p3_vec.x),f2glf(pnt->p3_vec.y),-f2glf(pnt->p3_vec.z)); // glEnd(); glPushMatrix(); - mprintf((0,"circle: %f(%i),%f(%i),%f\n",(f2fl(xc1)+grd_curcanv->cv_bitmap.bm_x)/(float)last_width,f2i(xc1),(f2fl(yc1)+grd_curcanv->cv_bitmap.bm_y)/(float)last_height,f2i(yc1),f2fl(r1))); + glmprintf((0,"circle: %f(%i),%f(%i),%f\n",(f2fl(xc1)+grd_curcanv->cv_bitmap.bm_x)/(float)last_width,f2i(xc1),(f2fl(yc1)+grd_curcanv->cv_bitmap.bm_y)/(float)last_height,f2i(yc1),f2fl(r1))); glTranslatef( (f2fl(xc1)+grd_curcanv->cv_bitmap.bm_x)/(float)last_width, 1.0-(f2fl(yc1)+grd_curcanv->cv_bitmap.bm_y)/(float)last_height,0); @@ -603,7 +646,7 @@ bool g3_draw_tmap(int nv,g3s_point **pointlist,g3s_uvl *uvl_list,grs_bitmap *bm) for (i=0; ibm_w !=64||bm->bm_h!=64) - printf("g3_draw_tmap w %i h %i\n",bm->bm_w,bm->bm_h);*/ - OGL_ENABLE(TEXTURE_2D); - ogl_bindbmtex(bm); - ogl_texwrap(bm->gltexture,GL_REPEAT); - glBegin(GL_TRIANGLE_FAN); - for (c=0;cbm_w !=64||bm->bm_h!=64) + printf("g3_draw_tmap w %i h %i\n",bm->bm_w,bm->bm_h);*/ + if (ogl_arb_multitexture_ok){ +#ifdef GL_ARB_multitexture + glActiveTextureARB(GL_TEXTURE0_ARB); +#endif + }else if (ogl_sgis_multitexture_ok){ +#ifdef GL_SGIS_multitexture + glSelectTextureSGIS(GL_TEXTURE0_SGIS); +#endif } - if (bm->bm_flags&BM_FLAG_NO_LIGHTING){ - l=1.0; - }else{ - //l=f2fl(uvl_list[c].l)+gr_palette_gamma/63.0; - l=f2fl(uvl_list[c].l); + ogl_bindbmtex(bmbot); + OGL_ENABLE(TEXTURE_2D); + glEnable(GL_TEXTURE_2D); + ogl_texwrap(bmbot->gltexture,GL_REPEAT); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + if (ogl_arb_multitexture_ok){ +#ifdef GL_ARB_multitexture + glActiveTextureARB(GL_TEXTURE1_ARB); +#endif + }else if (ogl_sgis_multitexture_ok){ +#ifdef GL_SGIS_multitexture + glSelectTextureSGIS(GL_TEXTURE1_SGIS); +#endif } - glColor3f(l,l,l); - glTexCoord2f(u1,v1); - //glVertex3f(f2glf(pointlist[c]->p3_vec.x),f2glf(pointlist[c]->p3_vec.y),f2glf(pointlist[c]->p3_vec.z)); - //glVertex3f(f2glf(pointlist[c]->p3_vec.x),f2glf(pointlist[c]->p3_vec.y),f2glf(pointlist[c]->p3_vec.z)); - glVertex3f(f2glf(pointlist[c]->p3_vec.x),f2glf(pointlist[c]->p3_vec.y),-f2glf(pointlist[c]->p3_vec.z)); + ogl_bindbmtex(bm); +// OGL_ENABLE(TEXTURE_2D); + glEnable(GL_TEXTURE_2D); + ogl_texwrap(bm->gltexture,GL_REPEAT); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + glBegin(GL_TRIANGLE_FAN); + for (c=0;cbm_flags&BM_FLAG_NO_LIGHTING){ + l=1.0; + }else{ + //l=f2fl(uvl_list[c].l)+gr_palette_gamma/63.0; + l=f2fl(uvl_list[c].l); + } + glColor3f(l,l,l); +// glTexCoord2f(f2glf(uvl_list[c].u),f2glf(uvl_list[c].v)); + if (ogl_arb_multitexture_ok){ +#ifdef GL_ARB_multitexture + glMultiTexCoord2fARB(GL_TEXTURE0_ARB,f2glf(uvl_list[c].u),f2glf(uvl_list[c].v)); +#endif + }else if (ogl_sgis_multitexture_ok){ +#ifdef GL_SGIS_multitexture + glMultiTexCoord2fSGIS(GL_TEXTURE0_SGIS,f2glf(uvl_list[c].u),f2glf(uvl_list[c].v)); +#endif + } + if (ogl_arb_multitexture_ok){ +#ifdef GL_ARB_multitexture + glMultiTexCoord2fARB(GL_TEXTURE1_ARB,u1,v1); +#endif + }else if (ogl_sgis_multitexture_ok){ +#ifdef GL_SGIS_multitexture + glMultiTexCoord2fSGIS(GL_TEXTURE1_SGIS,u1,v1); +#endif + } + //glVertex3f(f2glf(pointlist[c]->p3_vec.x),f2glf(pointlist[c]->p3_vec.y),f2glf(pointlist[c]->p3_vec.z)); + //glVertex3f(f2glf(pointlist[c]->p3_vec.x),f2glf(pointlist[c]->p3_vec.y),f2glf(pointlist[c]->p3_vec.z)); + glVertex3f(f2glf(pointlist[c]->p3_vec.x),f2glf(pointlist[c]->p3_vec.y),-f2glf(pointlist[c]->p3_vec.z)); + } + glEnd(); +/* if (ogl_arb_multitexture_ok){ +#ifdef GL_ARB_multitexture + glActiveTextureARB(GL_TEXTURE1_ARB); +#endif + }else if (ogl_sgis_multitexture_ok){ +#ifdef GL_SGIS_multitexture + glSelectTextureSGIS(GL_TEXTURE1_SGIS); +#endif + } +// OGL_ENABLE(TEXTURE_2D);*/ + glDisable(GL_TEXTURE_2D); + if (ogl_arb_multitexture_ok){ +#ifdef GL_ARB_multitexture + glActiveTextureARB(GL_TEXTURE0_ARB); +#endif + }else if (ogl_sgis_multitexture_ok){ +#ifdef GL_SGIS_multitexture + glSelectTextureSGIS(GL_TEXTURE0_SGIS); +#endif + } + }else +#endif + { + int c; + float l,u1,v1; + + g3_draw_tmap(nv,pointlist,uvl_list,bmbot);//draw the bottom texture first.. could be optimized with multitexturing.. + + r_tpolyc++; + /* if (bm->bm_w !=64||bm->bm_h!=64) + printf("g3_draw_tmap w %i h %i\n",bm->bm_w,bm->bm_h);*/ + OGL_ENABLE(TEXTURE_2D); + ogl_bindbmtex(bm); + ogl_texwrap(bm->gltexture,GL_REPEAT); + glBegin(GL_TRIANGLE_FAN); + for (c=0;cbm_flags&BM_FLAG_NO_LIGHTING){ + l=1.0; + }else{ + //l=f2fl(uvl_list[c].l)+gr_palette_gamma/63.0; + l=f2fl(uvl_list[c].l); + } + glColor3f(l,l,l); + glTexCoord2f(u1,v1); + //glVertex3f(f2glf(pointlist[c]->p3_vec.x),f2glf(pointlist[c]->p3_vec.y),f2glf(pointlist[c]->p3_vec.z)); + //glVertex3f(f2glf(pointlist[c]->p3_vec.x),f2glf(pointlist[c]->p3_vec.y),f2glf(pointlist[c]->p3_vec.z)); + glVertex3f(f2glf(pointlist[c]->p3_vec.x),f2glf(pointlist[c]->p3_vec.y),-f2glf(pointlist[c]->p3_vec.z)); + } + glEnd(); } - glEnd(); return 0; } @@ -811,7 +972,7 @@ bool ogl_ubitmapm(int x, int y,grs_bitmap *bm){ bool ogl_ubitblt(int w,int h,int dx,int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest) { GLfloat xo,yo;//,xs,ys; - mprintf((0,"ogl_ubitblt(w=%i,h=%i,dx=%i,dy=%i,sx=%i,sy=%i,src=%p,dest=%p\n",w,h, dx, dy,sx, sy, src,dest)); + glmprintf((0,"ogl_ubitblt(w=%i,h=%i,dx=%i,dy=%i,sx=%i,sy=%i,src=%p,dest=%p\n",w,h, dx, dy,sx, sy, src,dest)); dx+=dest->bm_x; dy+=dest->bm_y; @@ -834,7 +995,7 @@ bool ogl_ubitblt(int w,int h,int dx,int dy, int sx, int sy, grs_bitmap * src, gr return 0; } #else -bool ogl_ubitblt(int w,int h,int dx,int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest) +bool ogl_ubitblt_i(int dw,int dh,int dx,int dy, int sw, int sh, int sx, int sy, grs_bitmap * src, grs_bitmap * dest) { GLfloat xo,yo,xs,ys; GLfloat u1,v1;//,u2,v2; @@ -843,7 +1004,7 @@ bool ogl_ubitblt(int w,int h,int dx,int dy, int sx, int sy, grs_bitmap * src, gr r_ubitbltc++; ogl_init_texture(&tex); - tex.w=w;tex.h=h; + tex.w=sw;tex.h=sh; tex.prio=0.0;tex.wantmip=0; tex.lw=src->bm_rowsize; @@ -864,9 +1025,9 @@ bool ogl_ubitblt(int w,int h,int dx,int dy, int sx, int sy, grs_bitmap * src, gr dx+=dest->bm_x; dy+=dest->bm_y; xo=dx/(float)last_width; - xs=w/(float)last_width; + xs=dw/(float)last_width; yo=1.0-dy/(float)last_height; - ys=h/(float)last_height; + ys=dh/(float)last_height; OGL_ENABLE(TEXTURE_2D); @@ -889,46 +1050,48 @@ bool ogl_ubitblt(int w,int h,int dx,int dy, int sx, int sy, grs_bitmap * src, gr ogl_freetexture(&tex); return 0; } +bool ogl_ubitblt(int w,int h,int dx,int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest){ + return ogl_ubitblt_i(w,h,dx,dy,w,h,sx,sy,src,dest); +} #endif bool ogl_ubitblt_tolinear(int w,int h,int dx,int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest){ #if 1 - grs_bitmap tmp; unsigned char *d,*s; int i,j; int w1,h1; - char data[1024*1024]; // w1=w;h1=h; w1=grd_curscreen->sc_w;h1=grd_curscreen->sc_h; - if (ogl_readpixels_ok){ + if (w1*h1*3>OGLTEXBUFSIZE) + Error("ogl_ubitblt_tolinear: screen res larger than OGLTEXBUFSIZE\n"); + + if (ogl_readpixels_ok>0){ OGL_DISABLE(TEXTURE_2D); glReadBuffer(GL_FRONT); - glReadPixels(0,0,grd_curscreen->sc_w,grd_curscreen->sc_h,GL_RGB,GL_UNSIGNED_BYTE,texbuf); + glReadPixels(0,0,w1,h1,GL_RGB,GL_UNSIGNED_BYTE,texbuf); // glReadPixels(sx,grd_curscreen->sc_h-(sy+h),w,h,GL_RGB,GL_UNSIGNED_BYTE,texbuf); // glReadPixels(sx,sy,w+sx,h+sy,GL_RGB,GL_UNSIGNED_BYTE,texbuf); }else memset(texbuf,0,w1*h1*3); -//gr_init_bitmap( grs_bitmap *bm, int mode, int x, int y, int w, int h, int bytesperline, unsigned char * data ) // TODO: virtualize - gr_init_bitmap(&tmp,BM_LINEAR,0,0,w1,h1,w1,data); - d=data; - for (i=0;ibm_x; + sy+=src->bm_y; + for (i=0;ibm_data+dx+(dy+i)*dest->bm_rowsize; + s=texbuf+((h1-(i+sy+1))*w1+sx)*3; + for (j=0;jbm_x; - sy+=src->bm_y; - gr_bm_ubitbltm(w,h,dx,dy,sx,sy,&tmp,dest); -// gr_bm_ubitbltm(w,h,dx,dy,0,0,&tmp,dest); #else int i,j,c=0; unsigned char *d,*s,*e; + if (w*h*3>OGLTEXBUFSIZE) + Error("ogl_ubitblt_tolinear: size larger than OGLTEXBUFSIZE\n"); sx+=src->bm_x; sy+=src->bm_y; #if 1//also seems to cause a mess. need to look into it a bit more.. - if (ogl_readpixels_ok){ + if (ogl_readpixels_ok>0){ OGL_DISABLE(TEXTURE_2D); glReadBuffer(GL_FRONT); // glReadPixels(0,0,w,h,GL_RGB,GL_UNSIGNED_BYTE,texbuf); @@ -957,7 +1120,7 @@ bool ogl_ubitblt_tolinear(int w,int h,int dx,int dy, int sx, int sy, grs_bitmap d=e; d+=dest->bm_rowsize; } - mprintf((0,"c=%i w*h=%i\n",c,w*h)); + glmprintf((0,"c=%i w*h=%i\n",c,w*h)); #endif return 0; } @@ -1046,7 +1209,7 @@ void ogl_swap_buffers(void){ ogl_clean_texture_cache(); if (gr_renderstats){ gr_printf(5,GAME_FONT->ft_h*13+3*13,"%i flat %i tex %i sprites %i bitmaps",r_polyc,r_tpolyc,r_bitmapc,r_ubitmapc); -// mprintf((0,"ogl_end_frame: %i polys, %i tmaps, %i sprites, %i bitmaps, %i bitblts, %i pixels\n",r_polyc,r_tpolyc,r_bitmapc,r_ubitmapc,r_ubitbltc,r_upixelc));//we need to do it here because some things get drawn after end_frame +// glmprintf((0,"ogl_end_frame: %i polys, %i tmaps, %i sprites, %i bitmaps, %i bitblts, %i pixels\n",r_polyc,r_tpolyc,r_bitmapc,r_ubitmapc,r_ubitbltc,r_upixelc));//we need to do it here because some things get drawn after end_frame } ogl_do_palfx(); ogl_swap_buffers_internal(); @@ -1054,13 +1217,24 @@ void ogl_swap_buffers(void){ } int tex_format_supported(int iformat,int format){ - int internalFormat; - glTexImage2D(GL_PROXY_TEXTURE_2D, 0, iformat, 64, 64, 0, - format, GL_UNSIGNED_BYTE, texbuf);//NULL? - glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 0, - GL_TEXTURE_INTERNAL_FORMAT, - &internalFormat); - return (internalFormat==iformat); + switch (iformat){ + case GL_INTENSITY4: + if (!ogl_intensity4_ok) return 0; break; + case GL_LUMINANCE4_ALPHA4: + if (!ogl_luminance4_alpha4_ok) return 0; break; + case GL_RGBA2: + if (!ogl_rgba2_ok) return 0; break; + } + if (ogl_gettexlevelparam_ok){ + int internalFormat; + glTexImage2D(GL_PROXY_TEXTURE_2D, 0, iformat, 64, 64, 0, + format, GL_UNSIGNED_BYTE, texbuf);//NULL? + glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 0, + GL_TEXTURE_INTERNAL_FORMAT, + &internalFormat); + return (internalFormat==iformat); + }else + return 1; } //little hack to find the largest or equal multiple of 2 for a given number @@ -1131,7 +1305,7 @@ void ogl_filltexbuf(unsigned char *data,GLubyte *texp,int truewidth,int width,in } int tex_format_verify(ogl_texture *tex){ while (!tex_format_supported(tex->internalformat,tex->format)){ - mprintf((0,"tex format %x not supported",tex->internalformat)); + glmprintf((0,"tex format %x not supported",tex->internalformat)); switch (tex->internalformat){ case GL_INTENSITY4: if (ogl_luminance4_alpha4_ok){ @@ -1153,7 +1327,7 @@ int tex_format_verify(ogl_texture *tex){ mprintf((0,"...no tex format to fall back on\n")); return 1; } - mprintf((0,"...falling back to %x\n",tex->internalformat)); + glmprintf((0,"...falling back to %x\n",tex->internalformat)); } return 0; } @@ -1161,29 +1335,34 @@ void tex_set_size1(ogl_texture *tex,int dbits,int bits,int w, int h){ int u; if (tex->tw!=w || tex->th!=h){ u=(tex->w/(float)tex->tw*w) * (tex->h/(float)tex->th*h); - mprintf((0,"shrunken texture?\n")); + glmprintf((0,"shrunken texture?\n")); }else u=tex->w*tex->h; - if (bits<=0){//the beta nvidia GLX serverdoesn't ever return any bit sizes, so just use some assumptions. + if (bits<=0){//the beta nvidia GLX server. doesn't ever return any bit sizes, so just use some assumptions. tex->bytes=((float)w*h*dbits)/8.0; tex->bytesu=((float)u*dbits)/8.0; }else{ tex->bytes=((float)w*h*bits)/8.0; tex->bytesu=((float)u*bits)/8.0; } - mprintf((0,"tex_set_size1: %ix%i, %ib(%i) %iB\n",w,h,bits,dbits,tex->bytes)); + glmprintf((0,"tex_set_size1: %ix%i, %ib(%i) %iB\n",w,h,bits,dbits,tex->bytes)); } void tex_set_size(ogl_texture *tex){ -// int w,h,r,g,b,a; - int w,h,bi=16,a=0,t; - glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_WIDTH,&w); - glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_HEIGHT,&h); - glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_LUMINANCE_SIZE,&t);a+=t; - glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_INTENSITY_SIZE,&t);a+=t; - glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_RED_SIZE,&t);a+=t; - glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_GREEN_SIZE,&t);a+=t; - glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_BLUE_SIZE,&t);a+=t; - glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_ALPHA_SIZE,&t);a+=t; + int w,h,bi=16,a=0; + if (ogl_gettexlevelparam_ok){ + int t; + glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_WIDTH,&w); + glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_HEIGHT,&h); + glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_LUMINANCE_SIZE,&t);a+=t; + glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_INTENSITY_SIZE,&t);a+=t; + glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_RED_SIZE,&t);a+=t; + glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_GREEN_SIZE,&t);a+=t; + glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_BLUE_SIZE,&t);a+=t; + glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_ALPHA_SIZE,&t);a+=t; + }else{ + w=tex->tw; + h=tex->th; + } switch (tex->format){ case GL_LUMINANCE: bi=8; @@ -1211,6 +1390,7 @@ void ogl_loadtexture(unsigned char * data, int dxo,int dyo, ogl_texture *tex){ // int format=GL_RGBA; //int filltype=0; tex->tw=pow2ize(tex->w);tex->th=pow2ize(tex->h);//calculate smallest texture size that can accomodate us (must be multiples of 2) +// tex->tw=tex->w;tex->th=tex->h;//feeling lucky? if(gr_badtexture>0) return; @@ -1222,7 +1402,7 @@ void ogl_loadtexture(unsigned char * data, int dxo,int dyo, ogl_texture *tex){ tex->v=(float)tex->h/(float)tex->th; // if (width!=twidth || height!=theight) - // mprintf((0,"sizing %ix%i texture up to %ix%i\n",width,height,twidth,theight)); + // glmprintf((0,"sizing %ix%i texture up to %ix%i\n",width,height,twidth,theight)); ogl_filltexbuf(data,texbuf,tex->lw,tex->w,tex->h,dxo,dyo,tex->tw,tex->th,tex->format); // Generate OpenGL texture IDs. @@ -1258,7 +1438,7 @@ void ogl_loadtexture(unsigned char * data, int dxo,int dyo, ogl_texture *tex){ tex_set_size(tex); r_texcount++; - mprintf((0,"ogl_loadtexture(%p,%i,%i,%ix%i,%p):%i u=%f v=%f b=%i bu=%i (%i)\n",data,tex->tw,tex->th,dxo,dyo,tex,tex->handle,tex->u,tex->v,tex->bytes,tex->bytesu,r_texcount)); + glmprintf((0,"ogl_loadtexture(%p,%i,%i,%ix%i,%p):%i u=%f v=%f b=%i bu=%i (%i)\n",data,tex->tw,tex->th,dxo,dyo,tex,tex->handle,tex->u,tex->v,tex->bytes,tex->bytesu,r_texcount)); } unsigned char decodebuf[512*512]; @@ -1305,7 +1485,7 @@ void ogl_loadbmtexture(grs_bitmap *bm){ void ogl_freetexture(ogl_texture *gltexture){ if (gltexture->handle>0){ r_texcount--; - mprintf((0,"ogl_freetexture(%p):%i (last rend %is) (%i left)\n",gltexture,gltexture->handle,(GameTime-gltexture->lastrend)/f1_0,r_texcount)); + glmprintf((0,"ogl_freetexture(%p):%i (last rend %is) (%i left)\n",gltexture,gltexture->handle,(GameTime-gltexture->lastrend)/f1_0,r_texcount)); glDeleteTextures( 1, &gltexture->handle ); // gltexture->handle=0; ogl_init_texture(gltexture); @@ -1316,10 +1496,8 @@ void ogl_freebmtexture(grs_bitmap *bm){ ogl_freetexture(bm->gltexture); bm->gltexture=NULL; // r_texcount--; -// mprintf((0,"ogl_freebmtexture(%p,%p):%i (%i left)\n",bm->bm_data,&bm->gltexture,bm->gltexture,r_texcount)); +// glmprintf((0,"ogl_freebmtexture(%p,%p):%i (%i left)\n",bm->bm_data,&bm->gltexture,bm->gltexture,r_texcount)); // glDeleteTextures( 1, &bm->gltexture ); // bm->gltexture=-1; } } - -#endif // OGL diff --git a/video/ogl_glx.c b/video/ogl_glx.c index e52258e9..a222da0a 100644 --- a/video/ogl_glx.c +++ b/video/ogl_glx.c @@ -1,6 +1,17 @@ -//opengl platform specific functions for GLX - Added 9/15/99 Matthew Mueller +/* + * $Source: /cvs/cvsroot/d2x/video/ogl_glx.c,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 13:47:52 $ + * + * opengl platform specific functions for GLX - Added 9/15/99 Matthew Mueller + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H #include -#ifdef OGL +#endif #include #include @@ -239,5 +250,3 @@ void ogl_close(void){ } XCloseDisplay(dpy); } - -#endif //OGL diff --git a/video/ogl_gr.c b/video/ogl_gr.c index 9ed996ae..b8352f2b 100644 --- a/video/ogl_gr.c +++ b/video/ogl_gr.c @@ -1,8 +1,20 @@ -// OGL video functions. - Added 9/15/99 Matthew Mueller - +/* + * $Source: /cvs/cvsroot/d2x/video/ogl_gr.c,v $ + * $Revision: 1.5 $ + * $Author: bradleyb $ + * $Date: 2001-10-12 00:18:40 $ + * + * // OGL video functions. - Added 9/15/99 Matthew Mueller + * + * $Log: not supported by cvs2svn $ + * Revision 1.4 2001/01/29 13:47:52 bradleyb + * Fixed build, some minor cleanups. + * + */ + +#ifdef HAVE_CONFIG_H #include -#ifdef OGL - +#endif #include #include @@ -227,10 +239,9 @@ int ogl_testneedmipmaps(int i){ // return -1; } #ifdef OGL_RUNTIME_LOAD -#ifdef __WINDOWS__ +#if defined(__WINDOWS__) || defined(__MINGW32__) char *OglLibPath="opengl32.dll"; -#endif -#ifdef __LINUX__ +#elif defined(__ENV_LINUX__) char *OglLibPath="libGL.so"; #endif @@ -527,7 +538,7 @@ void gr_palette_read(ubyte * pal) //if we got really spiffy, we could optionally link in libpng or something, and use that. void write_bmp(char *savename,int w,int h,unsigned char *buf){ int f; -#ifdef __WINDOWS__ +#if defined(__WINDOWS__) || defined (__MINGW32__) f=open(savename,O_CREAT|O_EXCL|O_WRONLY,S_IRUSR|S_IWUSR); #else f=open(savename,O_CREAT|O_EXCL|O_WRONLY,S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); @@ -621,5 +632,3 @@ void save_screen_shot(int automap_flag) key_flush(); start_time(); } - -#endif //OGL diff --git a/video/ogl_sdl.c b/video/ogl_sdl.c new file mode 100644 index 00000000..b20c1b8f --- /dev/null +++ b/video/ogl_sdl.c @@ -0,0 +1,96 @@ +/* + * $Source: /cvs/cvsroot/d2x/video/ogl_sdl.c,v $ + * $Revision: 1.4 $ + * $Author: bradleyb $ + * $Date: 2001-10-09 08:17:07 $ + * + * Graphics functions for SDL-GL. + * + * $Log: not supported by cvs2svn $ + * Revision 1.3 2001/10/09 02:58:20 bradleyb + * Added window caption, hide mouse cursor + * + * Revision 1.2 2001/01/29 13:47:52 bradleyb + * Fixed build, some minor cleanups. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include "ogl_init.h" +#include "vers_id.h" +#include "error.h" +#include "event.h" +#include "mono.h" +#include "u_mem.h" + +static int gl_initialized = 0; + +void ogl_do_fullscreen_internal(void){ + if (ogl_fullscreen) + { + SDL_Surface *screen; + + screen = SDL_GetVideoSurface(); + SDL_WM_ToggleFullScreen(screen); + } + +} + +inline void ogl_swap_buffers_internal(void){ + SDL_GL_SwapBuffers(); +} +int ogl_init_window(int x, int y){ + + Uint32 video_flags; + int bpp = 16; + + + if (SDL_Init(SDL_INIT_VIDEO) < 0) + { + Error("SDL library video initialisation failed: %s.",SDL_GetError()); + } + video_flags = SDL_OPENGL; + + if (ogl_fullscreen) video_flags |= SDL_FULLSCREEN; + + SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 ); + SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 ); + SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 ); +// SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 1 ); + SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, bpp ); + SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); + + SDL_WM_SetCaption(DESCENT_VERSION, "Descent II"); + + if ( SDL_SetVideoMode( x, y, bpp, video_flags ) == NULL ) { + fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError()); + SDL_Quit(); + exit(1); + } + + SDL_ShowCursor(0); + + printf( "Vendor : %s\n", glGetString( GL_VENDOR ) ); + printf( "Renderer : %s\n", glGetString( GL_RENDERER ) ); + printf( "Version : %s\n", glGetString( GL_VERSION ) ); + printf( "Extensions : %s\n", glGetString( GL_EXTENSIONS ) ); + printf("\n"); + + + return 0; +} +void ogl_destroy_window(void){ + return; +} +void ogl_init(void){ + gl_initialized=1; +} +void ogl_close(void){ + ogl_destroy_window(); +} diff --git a/video/ogl_wgl.c b/video/ogl_wgl.c index 0b3dc03c..bdaa8c2d 100644 --- a/video/ogl_wgl.c +++ b/video/ogl_wgl.c @@ -1,6 +1,21 @@ -//opengl platform specific functions for WGL - added by Peter Hawkins -//fullscreen example code courtesy of Jeff Slutter -//everything merged together and cleaned up by Matt Mueller (with some win32 help from Nirvana) +/* + * $Source: /cvs/cvsroot/d2x/video/ogl_wgl.c,v $ + * $Revision: 1.2 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 13:47:52 $ + * + * opengl platform specific functions for WGL - added by Peter Hawkins + * fullscreen example code courtesy of Jeff Slutter + * everything merged together and cleaned up by Matt Mueller + * (with some win32 help from Nirvana) + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include "ogl_init.h" diff --git a/video/sdl_gr.c b/video/sdl_gr.c index 5546ec7c..779aa543 100644 --- a/video/sdl_gr.c +++ b/video/sdl_gr.c @@ -1,7 +1,23 @@ -// SDL video functions. - +/* + * $Source: /cvs/cvsroot/d2x/video/sdl_gr.c,v $ + * $Revision: 1.5 $ + * $Author: bradleyb $ + * $Date: 2001-10-09 08:17:07 $ + * + * SDL video functions. + * + * $Log: not supported by cvs2svn $ + * Revision 1.4 2001/01/31 13:59:23 bradleyb + * Fullscreen toggle added to screen res menu + * + * Revision 1.3 2001/01/29 13:47:52 bradleyb + * Fixed build, some minor cleanups. + * + */ + +#ifdef HAVE_CONFIG_H #include -#ifdef SDL_VIDEO +#endif #include #include @@ -92,7 +108,7 @@ int gr_set_mode(u_int32_t mode) //Style "D1X*" NoTitle, NoHandles, BorderWidth 0 //if you can't use -fullscreen like me (crashes X), this is a big help in //getting the window centered correctly (if you use SmartPlacement) - SDL_WM_SetCaption("D2x", "Descent II"); + SDL_WM_SetCaption(DESCENT_VERSION, "Descent II"); //end addition -MM //edited 10/05/98 by Matt Mueller - make fullscreen mode optional @@ -136,14 +152,16 @@ int gr_set_mode(u_int32_t mode) return 0; } - - int gr_check_fullscreen(void){ return (sdl_video_flags & SDL_FULLSCREEN)?1:0; } + int gr_toggle_fullscreen(void){ sdl_video_flags^=SDL_FULLSCREEN; +/* grd_curscreen->sc_mode=0;//hack to get it to reset screen mode +*/ + SDL_WM_ToggleFullScreen(screen); return (sdl_video_flags & SDL_FULLSCREEN)?1:0; } @@ -163,14 +181,14 @@ int gr_init(void) memset( grd_curscreen, 0, sizeof(grs_screen)); //added 10/05/98 by Matt Mueller - make fullscreen mode optional - if (args_find("-fullscreen")) + if (FindArg("-fullscreen")) sdl_video_flags|=SDL_FULLSCREEN; //end addition -MM //added 05/19/99 Matt Mueller - make HW surface optional - if (args_find("-hwsurface")) + if (FindArg("-hwsurface")) sdl_video_flags|=SDL_HWSURFACE; //end addition -MM - if (args_find("-nosdlvidmodecheck")) + if (FindArg("-nosdlvidmodecheck")) checkvidmodeok=0; // Set the mode. @@ -448,5 +466,3 @@ void gr_palette_read(ubyte * pal) pal[j++] = palette->colors[i].b / 4; } } - -#endif // SDL_VIDEO diff --git a/arch/linux/svgalib/gr.c b/video/svgalib_gr.c similarity index 94% rename from arch/linux/svgalib/gr.c rename to video/svgalib_gr.c index 2aee9776..6d092ffe 100644 --- a/arch/linux/svgalib/gr.c +++ b/video/svgalib_gr.c @@ -1,3 +1,18 @@ +/* + * $Source: /cvs/cvsroot/d2x/video/svgalib_gr.c,v $ + * $Revision: 1.2 $ + * $Author: bradleyb $ + * $Date: 2001-01-29 13:47:52 $ + * + * SVGALib video functions + * + * $Log: not supported by cvs2svn $ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -101,14 +116,16 @@ int gr_set_mode(u_int32_t mode) grd_curscreen->sc_canvas.cv_bitmap.bm_data = framebuffer; gr_set_current_canvas(NULL); - gamefont_choose_game_font(w,h); + //gamefont_choose_game_font(w,h); return 0; } -int gr_init(int mode) +int gr_init(void) { int retcode; + int mode = SM(320,200); + // Only do this function once! if (gr_installed==1) return -1; @@ -306,4 +323,3 @@ void gr_palette_read (ubyte *pal) for (i = 0; i < 768; i++) pal[i] = colors[i]; } - -- 2.39.2