From a0fe572bf20325c70eba53f75d42b27eb6d0b2d9 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Fri, 12 Oct 2001 00:18:40 +0000 Subject: [PATCH] Switched from Cygwin to mingw32 on MS boxes. Vastly improved compilability. --- Makefile.am | 2 +- aclocal.m4 | 2 +- arch/Makefile.am | 4 +- arch/include/joy.h | 11 ++- arch/include/mouse.h | 13 ++-- autogen.sh | 2 +- conf.h.in | 2 +- configure.in | 67 ++++++++--------- cygconf | 2 + include/loadgl.h | 2 +- include/pstypes.h | 29 +++----- include/strutil.h | 24 +++--- input/Makefile.am | 6 +- macros/Makefile.am | 2 - macros/sdl.m4 | 173 ------------------------------------------- main/Makefile.am | 6 +- main/config.c | 6 +- main/console.c | 2 +- main/gamepal.h | 3 - main/gamerend.c | 4 +- main/inferno.c | 1 - main/kconfig.c | 4 +- main/multi.c | 2 +- main/newdemo.c | 2 + misc/d_delay.c | 2 +- misc/d_glob.c | 4 +- misc/strutil.c | 8 +- video/ogl.c | 9 ++- video/ogl_gr.c | 14 ++-- 29 files changed, 110 insertions(+), 298 deletions(-) create mode 100644 cygconf delete mode 100644 macros/Makefile.am delete mode 100644 macros/sdl.m4 diff --git a/Makefile.am b/Makefile.am index a6e99f13..ceed96e7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ SUBDIRS = 2d 3d maths mem cfile iff texmap misc input video sound arch main \ -includes tools unused macros +includes tools unused changelog:: -touch ChangeLog diff --git a/aclocal.m4 b/aclocal.m4 index 2f8342ea..a60c657f 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,4 +1,4 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p4 +dnl aclocal.m4 generated automatically by aclocal 1.4 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation diff --git a/arch/Makefile.am b/arch/Makefile.am index 57ad950a..9ee9d599 100644 --- a/arch/Makefile.am +++ b/arch/Makefile.am @@ -7,7 +7,7 @@ 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 ENV_CYGWIN +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 @@ -15,7 +15,7 @@ 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 ENV_CYGWIN +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 diff --git a/arch/include/joy.h b/arch/include/joy.h index c7489665..69b4054b 100644 --- a/arch/include/joy.h +++ b/arch/include/joy.h @@ -13,13 +13,16 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. /* * $Source: /cvs/cvsroot/d2x/arch/include/joy.h,v $ - * $Revision: 1.2 $ + * $Revision: 1.3 $ * $Author: bradleyb $ - * $Date: 2001-01-29 13:36:14 $ + * $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. * @@ -52,7 +55,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #define JOY_NUM_AXES 4 #endif -#ifdef _WIN32 +#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) @@ -150,7 +153,7 @@ extern void joy_set_btn_values( int btn, int state, fix timedown, int downcount, extern int joy_get_scaled_reading( int raw, int axn ); extern void joy_set_slow_reading( int flag ); -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__MINGW32__) extern int joy95_init_stick(int joy, int spjoy); #endif diff --git a/arch/include/mouse.h b/arch/include/mouse.h index 941dee6e..f246d5c5 100644 --- a/arch/include/mouse.h +++ b/arch/include/mouse.h @@ -13,13 +13,16 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. /* * $Source: /cvs/cvsroot/d2x/arch/include/mouse.h,v $ - * $Revision: 1.2 $ + * $Revision: 1.3 $ * $Author: bradleyb $ - * $Date: 2001-01-31 16:31:13 $ + * $Date: 2001-10-12 00:18:37 $ * * Header for mouse functions * * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/01/31 16:31:13 bradleyb + * OpenGL support under Cygwin/SDL + * * Revision 1.1 2001/01/28 05:46:33 bradleyb * Unified arch headers * @@ -32,13 +35,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "fix.h" #define MB_LEFT 0 - -#if defined(_WIN32) || defined(__CYGWIN__) -#undef MB_RIGHT -#endif - #define MB_RIGHT 1 - #define MB_MIDDLE 2 #define MB_Z_UP 3 #define MB_Z_DOWN 4 diff --git a/autogen.sh b/autogen.sh index b33099fa..07212a61 100644 --- a/autogen.sh +++ b/autogen.sh @@ -1,6 +1,6 @@ #!/bin/sh set -e -aclocal -I macros +aclocal $ACLOCAL_FLAGS autoheader automake --add-missing autoconf diff --git a/conf.h.in b/conf.h.in index e2ff5292..a533786f 100644 --- a/conf.h.in +++ b/conf.h.in @@ -1,4 +1,4 @@ -/* conf.h.in. Generated automatically from configure.in by autoheader 2.13. */ +/* conf.h.in. Generated automatically from configure.in by autoheader. */ /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS diff --git a/configure.in b/configure.in index bd3d5927..eb9a0eaf 100644 --- a/configure.in +++ b/configure.in @@ -19,10 +19,26 @@ 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="-g -O2 -Wall" +CFLAGS="$CFLAGS -g -O2 -Wall" dnl Count warnings as errors? AC_ARG_WITH(werror, @@ -53,21 +69,16 @@ if test "$host_os" = "msdosdjgpp"; then else CFLAGS="-pipe $CFLAGS" - AM_CONDITIONAL(ENV_CYGWIN, test "$host_os" = "cygwin") - AC_DEFINE(__ENV_LINUX__) + case "$host_os" in + *linux*) AC_DEFINE(__ENV_LINUX__) ;; + esac + dnl Check for SDL AM_PATH_SDL(1.1.7, - AC_MSG_RESULT([SDL_CFLAGS=$SDL_CFLAGS SDL_LIBS=$SDL_LIBS]), + :, AC_MSG_ERROR(SDL not found. Make sure sdl-config is in your PATH, or specify with --with-sdl-prefix) ) - if test "$host_os" = "cygwin"; then - # mingw32-specific stuff, I guess...? - SDL_CFLAGS=`echo $SDL_CFLAGS | sed 's/-Dmain=SDL_main//'` - SDL_LIBS=`echo $SDL_LIBS | sed 's/-lmingw32//' | sed 's/-mwindows//' | sed 's/-lSDLmain//'` - AC_MSG_RESULT([Using SDL_CFLAGS=$SDL_CFLAGS SDL_LIBS=$SDL_LIBS]) - fi - AC_SUBST(SDL_LIBS) AC_CHECK_HEADERS(netipx/ipx.h) @@ -80,31 +91,15 @@ else no) opengl=false ;; *) AC_MSG_ERROR(bad value ${withval} for --with-opengl) ;; esac],[opengl=false]) - + if test x$opengl = xtrue; then - if test "$host_os" = "cygwin"; then - AC_CHECK_LIB(opengl32, main, - OGL_LIBS="-lopengl32", - [AC_MSG_ERROR([opengl32 not found, OpenGL cannot be built]) - opengl=false], - ) - AC_CHECK_LIB(glu32,main, - OGL_LIBS="${OGL_LIBS} -lglu32", - [AC_MSG_ERROR([glu32 not found, OpenGL cannot be built]) - opengl=false], - -lopengl32) - else - AC_CHECK_LIB(GL, main, - OGL_LIBS="-lGL", - [AC_MSG_ERROR([GL not found, OpenGL cannot be built]) - opengl=false], - ) - AC_CHECK_LIB(GLU,main, - OGL_LIBS="${OGL_LIBS} -lGLU", - [AC_MSG_ERROR([GLU not found, OpenGL cannot be built]) - opengl=false], - -lGL) - fi + 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], + ) + done fi AC_SUBST(OGL_LIBS) AM_CONDITIONAL(USE_OPENGL, test x$opengl = xtrue) @@ -178,8 +173,6 @@ else 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 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/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/pstypes.h b/include/pstypes.h index ca0cdd20..a8d49b5c 100644 --- a/include/pstypes.h +++ b/include/pstypes.h @@ -22,38 +22,33 @@ typedef signed char byte; //define unsigned types; typedef unsigned char ubyte; -#if defined __CYGWIN__ -# define _MAX_PATH 260 -# define _MAX_DIR 256 -# undef min +#ifndef __ENV_LINUX__ +typedef unsigned short ushort; +typedef unsigned int uint; +typedef unsigned long ulong; +#endif + # define min(a,b) (((a)>(b))?(b):(a)) -# undef max # define max(a,b) (((a)<(b))?(b):(a)) -typedef unsigned long ulong; + +#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 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 d2b1abf7..ff945cda 100644 --- a/include/strutil.h +++ b/include/strutil.h @@ -11,33 +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); -#if defined __CYGWIN__ -/* nothing needed */ - -#elif defined __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/input/Makefile.am b/input/Makefile.am index eae74938..a958b36b 100644 --- a/input/Makefile.am +++ b/input/Makefile.am @@ -7,6 +7,9 @@ noinst_LIBRARIES = libinput.a if ENV_DJGPP 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 @@ -15,9 +18,6 @@ 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 -if ENV_CYGWIN -libinput_a_SOURCES = sdl_event.c sdl_key.c sdl_mouse.c sdl_joy.c sdl_joydefs.c -else libinput_a_SOURCES = linux_joydefs.c linux_joystick.c \ sdl_event.c sdl_key.c sdl_mouse.c endif diff --git a/macros/Makefile.am b/macros/Makefile.am deleted file mode 100644 index 05ec5732..00000000 --- a/macros/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -EXTRA_DIST = \ -sdl.m4 diff --git a/macros/sdl.m4 b/macros/sdl.m4 deleted file mode 100644 index 36fb04af..00000000 --- a/macros/sdl.m4 +++ /dev/null @@ -1,173 +0,0 @@ -# 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/main/Makefile.am b/main/Makefile.am index 3041c32d..89b2c939 100644 --- a/main/Makefile.am +++ b/main/Makefile.am @@ -12,8 +12,8 @@ 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 ENV_CYGWIN -d2x_sdl_LDADD = ${d2x_LDADD} -lm ${SDL_LIBS} +if MINGW32 +d2x_sdl_LDADD = ${d2x_LDADD} ${SDL_LIBS} else d2x_sdl_LDADD = ${d2x_LDADD} -lm -ldl -lpthread ${SDL_LIBS} endif @@ -22,7 +22,7 @@ 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 \ diff --git a/main/config.c b/main/config.c index 1054e533..8da5cfb0 100644 --- a/main/config.c +++ b/main/config.c @@ -48,7 +48,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #ifdef RCS -static char rcsid[] = "$Id: config.c,v 1.3 2001-01-31 15:17:49 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; @@ -371,7 +371,7 @@ int ReadConfigFile() Config_digi_type = digi_driver_board; Config_digi_dma = digi_driver_dma;*/ -#if !defined WINDOWS && !defined __ENV_LINUX__ && !defined __ENV_DJGPP__ +#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; @@ -578,7 +578,7 @@ int WriteConfigFile() #endif #ifdef RCS -static char rcsid[] = "$Id: config.c,v 1.3 2001-01-31 15:17:49 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 17f529e7..6a941a69 100644 --- a/main/console.c +++ b/main/console.c @@ -13,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/gamepal.h b/main/gamepal.h index 04584274..609d615b 100644 --- a/main/gamepal.h +++ b/main/gamepal.h @@ -16,9 +16,6 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "inferno.h" -#ifdef __CYGWIN__ -#undef DEFAULT_PALETTE /* KLUDGE */ -#endif #define DEFAULT_PALETTE "default.256" #define MENU_PALETTE "default.256" diff --git a/main/gamerend.c b/main/gamerend.c index 32a2ac04..8fea3546 100644 --- a/main/gamerend.c +++ b/main/gamerend.c @@ -16,7 +16,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -static char rcsid[] = "$Id: gamerend.c,v 1.4 2001-01-31 15:17:52 bradleyb Exp $"; +static char rcsid[] = "$Id: gamerend.c,v 1.5 2001-10-12 00:18:38 bradleyb Exp $"; #endif #ifdef WINDOWS @@ -428,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" \ diff --git a/main/inferno.c b/main/inferno.c index 3a7cda75..3c5c752f 100644 --- a/main/inferno.c +++ b/main/inferno.c @@ -417,7 +417,6 @@ int main(int argc,char **argv) int i,t; ubyte title_pal[768]; - con_init(); // Initialise the console mem_init(); diff --git a/main/kconfig.c b/main/kconfig.c index 76782159..b1e213fc 100644 --- a/main/kconfig.c +++ b/main/kconfig.c @@ -16,7 +16,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -static char rcsid[] = "$Id: kconfig.c,v 1.7 2001-01-31 15:17:53 bradleyb Exp $"; +static char rcsid[] = "$Id: kconfig.c,v 1.8 2001-10-12 00:18:39 bradleyb Exp $"; #endif #ifdef WINDOWS @@ -3545,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/multi.c b/main/multi.c index c15aa35e..be249600 100644 --- a/main/multi.c +++ b/main/multi.c @@ -1059,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; diff --git a/main/newdemo.c b/main/newdemo.c index 1ef68a9b..9048e845 100644 --- a/main/newdemo.c +++ b/main/newdemo.c @@ -92,7 +92,9 @@ 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" diff --git a/misc/d_delay.c b/misc/d_delay.c index 35b30f59..06ffb727 100644 --- a/misc/d_delay.c +++ b/misc/d_delay.c @@ -8,7 +8,7 @@ #ifndef d_delay -#ifdef __WINDOWS__ +#if defined __WINDOWS__ || defined __MINGW32__ #include diff --git a/misc/d_glob.c b/misc/d_glob.c index 5e1f0ba6..0a5a4aa0 100644 --- a/misc/d_glob.c +++ b/misc/d_glob.c @@ -11,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) @@ -31,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/strutil.c b/misc/strutil.c index 05b2d69f..434533e4 100644 --- a/misc/strutil.c +++ b/misc/strutil.c @@ -34,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 ) @@ -59,11 +59,10 @@ int strnicmp( char *s1, char *s2, int n ) if (n) return 1; return 0; } - #endif -#if !defined __ENV_DJGPP__ && !defined __CYGWIN__ - +#ifndef __MINGW32__ +#ifndef __ENV_DJGPP__ void strlwr( char *s1 ) { while( *s1 ) { @@ -145,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/video/ogl.c b/video/ogl.c index dbc5ac92..089e63e8 100644 --- a/video/ogl.c +++ b/video/ogl.c @@ -1,12 +1,15 @@ /* * $Source: /cvs/cvsroot/d2x/video/ogl.c,v $ - * $Revision: 1.6 $ + * $Revision: 1.7 $ * $Author: bradleyb $ - * $Date: 2001-10-09 03:00:08 $ + * $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 * @@ -63,7 +66,7 @@ #define M_PI 3.14159 #endif -#ifdef __WINDOWS__ +#if defined(__WINDOWS__) || defined(__MINGW32__) #define cosf(a) cos(a) #define sinf(a) sin(a) #endif diff --git a/video/ogl_gr.c b/video/ogl_gr.c index 323ab558..b8352f2b 100644 --- a/video/ogl_gr.c +++ b/video/ogl_gr.c @@ -1,12 +1,15 @@ /* * $Source: /cvs/cvsroot/d2x/video/ogl_gr.c,v $ - * $Revision: 1.4 $ + * $Revision: 1.5 $ * $Author: bradleyb $ - * $Date: 2001-01-29 13:47:52 $ + * $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 @@ -236,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 @@ -536,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); -- 2.39.2