From 7d07635dcc99ab3073d59dc8be9548aa761bc075 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Wed, 26 Nov 2003 12:26:36 +0000 Subject: [PATCH] Visual C, PocketPC fixes --- 2d/font.c | 4 +- ChangeLog | 13 + VisualC/d2x/d2x.dsp | 789 ++++++++++++++++++++++++++++++- VisualCE/mveplayer/mveplayer.vcp | 97 ++-- arch/win32/ipx_mcast4.c | 16 +- arch/win32/ipx_udp.c | 8 +- arch/win32/ipx_win.c | 6 +- cfile/cfile.c | 36 +- console/CON_console.c | 8 +- include/d_io.h | 12 +- include/error.h | 25 +- include/pstypes.h | 58 ++- include/strutil.h | 18 +- include/u_dpmi.h | 47 +- libmve/mve_main.c | 6 +- libmve/mveplay.c | 17 +- main/cntrlcen.c | 6 +- main/gameseq.c | 7 +- main/movie.c | 8 +- main/newdemo.c | 6 +- main/newmenu.c | 29 +- main/newmenu.h | 22 +- main/playsave.c | 10 +- main/songs.c | 4 +- main/state.c | 12 +- main/text.c | 6 +- misc/args.c | 6 +- misc/d_io.c | 17 +- misc/strutil.c | 6 +- 29 files changed, 1087 insertions(+), 212 deletions(-) diff --git a/2d/font.c b/2d/font.c index eada64bd..bfc0f6c3 100644 --- a/2d/font.c +++ b/2d/font.c @@ -1,4 +1,4 @@ -/* $Id: font.c,v 1.25 2003-03-19 19:21:34 btb Exp $ */ +/* $Id: font.c,v 1.26 2003-11-26 12:26:23 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -27,8 +27,10 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include #include +#ifndef _MSC_VER #include #include +#endif #include "pa_enabl.h" //$$POLY_ACC #include "u_mem.h" diff --git a/ChangeLog b/ChangeLog index c0049c73..53b597b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2003-11-26 Bradley Bell + + * 2d/font.c, VisualC/d2x/d2x.dsp, + VisualCE/mveplayer/mveplayer.vcp, arch/win32/ipx_mcast4.c, + arch/win32/ipx_udp.c, arch/win32/ipx_win.c, cfile/cfile.c, + console/CON_console.c, include/d_io.h, include/error.h, + include/pstypes.h, include/strutil.h, include/u_dpmi.h, + libmve/mve_main.c, libmve/mveplay.c, main/cntrlcen.c, + main/gameseq.c, main/movie.c, main/newdemo.c, main/newmenu.c, + main/newmenu.h, main/playsave.c, main/songs.c, main/state.c, + main/text.c, misc/args.c, misc/d_io.c, misc/strutil.c: Visual C, + PocketPC fixes + 2003-11-25 Bradley Bell * VisualC/d2x, VisualC/d2x/.cvsignore, VisualC/d2x/d2x.dsp, diff --git a/VisualC/d2x/d2x.dsp b/VisualC/d2x/d2x.dsp index afbdf453..b266fff1 100644 --- a/VisualC/d2x/d2x.dsp +++ b/VisualC/d2x/d2x.dsp @@ -40,9 +40,10 @@ RSC=rc.exe # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "..\..\main" /I "..\..\arch\include" /I "..\..\..\..\sdl\SDL-1.2.6\include" /D "NDEBUG" /D "RELEASE" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "NO_ASM" /D "NMONO" /D "PIGGY_USE_PAGING" /D "NEWDEMO" /D "SDL_INPUT" /D "SDL_VIDEO" /D "FAST_FILE_IO" /D "CONSOLE" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "..\..\main" /I "..\..\arch\include" /I "..\..\arch\win32\include" /I "..\..\..\..\sdl\SDL-1.2.6\include" /D "NDEBUG" /D "RELEASE" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "NO_ASM" /D "NMONO" /D "PIGGY_USE_PAGING" /D "NEWDEMO" /D "SDL_INPUT" /D "SDL_VIDEO" /D "FAST_FILE_IO" /D "CONSOLE" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -52,7 +53,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:windows /machine:I386 !ELSEIF "$(CFG)" == "d2x - Win32 Debug" @@ -65,9 +66,10 @@ LINK32=link.exe # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "..\..\main" /I "..\..\arch\include" /I "..\..\..\..\sdl\SDL-1.2.6\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "NO_ASM" /D "NMONO" /D "PIGGY_USE_PAGING" /D "NEWDEMO" /D "SDL_INPUT" /D "SDL_VIDEO" /D "FAST_FILE_IO" /D "CONSOLE" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "..\..\main" /I "..\..\arch\include" /I "..\..\arch\win32\include" /I "..\..\..\..\sdl\SDL-1.2.6\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "NO_ASM" /D "NMONO" /D "PIGGY_USE_PAGING" /D "NEWDEMO" /D "SDL_INPUT" /D "SDL_VIDEO" /D "FAST_FILE_IO" /D "CONSOLE" /D "NETWORK" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -77,7 +79,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF @@ -310,266 +312,977 @@ SOURCE=..\..\misc\strutil.c # Begin Source File SOURCE=..\..\main\ai.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\ai2.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\aipath.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\automap.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\bm.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\cmd.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\cntrlcen.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\collide.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\config.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\console.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\controls.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\credits.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\crypt.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\effects.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\endlevel.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\escort.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\fireball.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\fuelcen.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\fvi.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\game.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\gamecntl.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\gamefont.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\gamemine.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\gamepal.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\gamerend.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\gamesave.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\gameseg.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\gameseq.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\gauges.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\hostage.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\hud.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\inferno.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\arch\win32\ipx_mcast4.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\arch\win32\ipx_udp.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\arch\win32\ipx_win.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\kconfig.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\main\kludge.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\main\kmatrix.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\main\laser.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\main\lighting.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\main\menu.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\main\mglobal.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\main\mission.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\main\morph.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\main\movie.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\main\multi.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File -SOURCE=..\..\main\kludge.c -# End Source File -# Begin Source File +SOURCE=..\..\main\multibot.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\main\netmisc.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF -SOURCE=..\..\main\laser.c # End Source File # Begin Source File -SOURCE=..\..\main\lighting.c -# End Source File -# Begin Source File +SOURCE=..\..\main\network.c -SOURCE=..\..\main\menu.c -# End Source File -# Begin Source File +!IF "$(CFG)" == "d2x - Win32 Release" -SOURCE=..\..\main\mglobal.c -# End Source File -# Begin Source File +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" -SOURCE=..\..\main\mission.c -# End Source File -# Begin Source File +# ADD CPP /D "NATIVE_IPX" -SOURCE=..\..\main\morph.c -# End Source File -# Begin Source File +!ENDIF -SOURCE=..\..\main\movie.c # End Source File # Begin Source File SOURCE=..\..\main\newdemo.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\newmenu.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\object.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\paging.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\physics.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\piggy.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\player.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\playsave.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\polyobj.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\powerup.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\render.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\robot.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\scores.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\segment.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\slew.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\songs.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\state.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\switch.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\terrain.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\texmerge.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\text.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\titles.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\vclip.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\wall.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # Begin Source File SOURCE=..\..\main\weapon.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\arch\win32\winnet.c + +!IF "$(CFG)" == "d2x - Win32 Release" + +!ELSEIF "$(CFG)" == "d2x - Win32 Debug" + +# ADD CPP /D "NATIVE_IPX" + +!ENDIF + # End Source File # End Group # Begin Group "maths" @@ -646,6 +1359,10 @@ SOURCE=..\..\include\d_io.h # End Source File # Begin Source File +SOURCE=..\..\include\error.h +# End Source File +# Begin Source File + SOURCE=..\..\include\fix.h # End Source File # Begin Source File @@ -658,6 +1375,18 @@ SOURCE=..\..\include\maths.h # End Source File # Begin Source File +SOURCE=..\..\include\mono.h +# End Source File +# Begin Source File + +SOURCE=..\..\main\newmenu.h +# End Source File +# Begin Source File + +SOURCE=..\..\main\piggy.h +# End Source File +# Begin Source File + SOURCE=..\..\include\pstypes.h # End Source File # Begin Source File @@ -666,8 +1395,20 @@ SOURCE=..\..\include\strutil.h # End Source File # Begin Source File +SOURCE=..\..\include\timer.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\u_dpmi.h +# End Source File +# Begin Source File + SOURCE=..\..\include\u_mem.h # End Source File +# Begin Source File + +SOURCE=..\..\main\vers_id.h +# End Source File # End Group # Begin Group "Resource Files" diff --git a/VisualCE/mveplayer/mveplayer.vcp b/VisualCE/mveplayer/mveplayer.vcp index 98c9d734..9b08d91c 100644 --- a/VisualCE/mveplayer/mveplayer.vcp +++ b/VisualCE/mveplayer/mveplayer.vcp @@ -77,6 +77,7 @@ LINK32=link.exe # PROP Intermediate_Dir "emulatorDbg" # PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" # PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Ignore_Export_Lib 0 # PROP Target_Dir "" RSC=rc.exe # ADD BASE RSC /l 0x409 /d "$(CePlatform)" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "_X86_" /d "x86" /d "_i386_" /r @@ -92,7 +93,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 +# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) ..\..\..\..\sdl\SDL12\VisualCE\SDL\emulatorDbg\SDL.lib ..\..\..\..\sdl\SDL12\VisualCE\SDLmain\emulatorDbg\SDLmain.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 !ELSEIF "$(CFG)" == "mveplayer - Win32 (WCE ARMV4) Release" @@ -125,7 +126,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM +# ADD LINK32 commctrl.lib coredll.lib aygshell.lib ..\..\..\..\sdl\SDL12\VisualCE\SDL\ARMV4Rel\SDL.lib ..\..\..\..\sdl\SDL12\VisualCE\SDLmain\ARMV4Rel\SDLmain.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM !ELSEIF "$(CFG)" == "mveplayer - Win32 (WCE ARMV4) Debug" @@ -208,62 +209,58 @@ NODEP_CPP_MVE_M=\ !ELSEIF "$(CFG)" == "mveplayer - Win32 (WCE emulator) Debug" DEP_CPP_MVE_M=\ + "..\..\..\..\sdl\SDL12\include\begin_code.h"\ + "..\..\..\..\sdl\SDL12\include\close_code.h"\ + "..\..\..\..\sdl\SDL12\include\SDL.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_active.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_audio.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_byteorder.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_cdrom.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_error.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_events.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_getenv.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_joystick.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_keyboard.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_keysym.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_main.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_mouse.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_mutex.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_quit.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_rwops.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_timer.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_types.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_version.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_video.h"\ "..\..\include\libmve.h"\ -NODEP_CPP_MVE_M=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - !ELSEIF "$(CFG)" == "mveplayer - Win32 (WCE ARMV4) Release" DEP_CPP_MVE_M=\ + "..\..\..\..\sdl\SDL12\include\begin_code.h"\ + "..\..\..\..\sdl\SDL12\include\close_code.h"\ + "..\..\..\..\sdl\SDL12\include\SDL.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_active.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_audio.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_byteorder.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_cdrom.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_error.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_events.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_getenv.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_joystick.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_keyboard.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_keysym.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_main.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_mouse.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_mutex.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_quit.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_rwops.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_timer.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_types.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_version.h"\ + "..\..\..\..\sdl\SDL12\include\SDL_video.h"\ "..\..\include\libmve.h"\ -NODEP_CPP_MVE_M=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - !ELSEIF "$(CFG)" == "mveplayer - Win32 (WCE ARMV4) Debug" diff --git a/arch/win32/ipx_mcast4.c b/arch/win32/ipx_mcast4.c index 80a432d6..6069f2ec 100644 --- a/arch/win32/ipx_mcast4.c +++ b/arch/win32/ipx_mcast4.c @@ -1,4 +1,4 @@ -/* $Id: ipx_mcast4.c,v 1.2 2003-10-14 20:48:15 btb Exp $ */ +/* $Id: ipx_mcast4.c,v 1.3 2003-11-26 12:26:25 btb Exp $ */ /* * @@ -14,7 +14,9 @@ #include #include #include +#ifndef _MSC_VER #include +#endif #include #include @@ -43,6 +45,7 @@ static struct in_addr game_addr; // The game's multicast address #define MSGHDR "IPX_mcast4: " +#ifdef __GNUC__ #ifdef IPX_MCAST4_DEBUG static void msg(const char *fmt, ...) { @@ -57,8 +60,19 @@ static void msg(const char *fmt, ...) #else #define msg(m...) #endif +#else +# ifdef IPX_MCAST4_DEBUG +# define msg printf +# else +# define msg +# endif +#endif +#ifdef __GNUC__ #define FAIL(m...) do{ nm_messagebox("Error", 1, "Ok", ##m); return -1; } while (0) +#else +# define FAIL() do{ nm_messagebox("Error", 1, "Ok", "IPX_mcast4 failure"); return -1; } while (0) +#endif #ifdef IPX_MCAST4_DEBUG /* Dump raw form of IP address/port by fancy output to user diff --git a/arch/win32/ipx_udp.c b/arch/win32/ipx_udp.c index 92bed29f..b2d52408 100644 --- a/arch/win32/ipx_udp.c +++ b/arch/win32/ipx_udp.c @@ -1,4 +1,4 @@ -/* $Id: ipx_udp.c,v 1.3 2003-10-12 09:17:47 btb Exp $ */ +/* $Id: ipx_udp.c,v 1.4 2003-11-26 12:26:25 btb Exp $ */ /* * * IPX driver for native Linux TCP/IP networking (UDP implementation) @@ -73,7 +73,9 @@ #include #include +#ifndef _MSC_VER #include +#endif #include #include #include @@ -156,7 +158,11 @@ static void chk(void *p) exit(EXIT_FAILURE); } +#ifdef _MSC_VER +#define FAIL Warning +#else #define FAIL(m...) do { msg(#m); return -1; } while (0) +#endif /* Find as much as MAX_BRDINTERFACES during local iface autoconfiguration. * Note that more interfaces can be added during manual configuration diff --git a/arch/win32/ipx_win.c b/arch/win32/ipx_win.c index b960ac2a..8740e358 100644 --- a/arch/win32/ipx_win.c +++ b/arch/win32/ipx_win.c @@ -1,4 +1,4 @@ -/* $Id: ipx_win.c,v 1.7 2003-10-12 09:17:47 btb Exp $ */ +/* $Id: ipx_win.c,v 1.8 2003-11-26 12:26:25 btb Exp $ */ /* * @@ -20,8 +20,12 @@ #include "ipx_drv.h" +#ifdef __GNUC__ #define _do_mprintf(n, format, args...) printf(format, ## args) #define mprintf(args) _do_mprintf args +#else +#define mprintf() +#endif //#define n_printf(format, args...) mprintf((1, format, ## args)) diff --git a/cfile/cfile.c b/cfile/cfile.c index 46a85553..75fbd265 100644 --- a/cfile/cfile.c +++ b/cfile/cfile.c @@ -1,4 +1,4 @@ -/* $Id: cfile.c,v 1.21 2003-10-05 22:35:47 btb Exp $ */ +/* $Id: cfile.c,v 1.22 2003-11-26 12:26:25 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -125,7 +125,11 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include #include +#ifndef _WIN32_WCE #include +#else +# include +#endif #include "pstypes.h" #include "u_mem.h" @@ -309,6 +313,7 @@ int cfile_init(char *hogname) int cfile_size(char *hogname) { +#ifndef _WIN32_WCE CFILE *fp; struct stat statbuf; @@ -318,6 +323,17 @@ int cfile_size(char *hogname) fstat(fileno(fp->file), &statbuf); cfclose(fp); return statbuf.st_size; +#else + CFILE *fp; + DWORD size; + + fp = cfopen(hogname, "rb"); + if (fp == NULL) + return -1; + size = GetFileSize(fileno(fp->file), NULL); + cfclose(fp); + return size; +#endif } /* @@ -466,24 +482,36 @@ int cfexist( char * filename ) // Deletes a file. int cfile_delete(char *filename) { +#ifndef _WIN32_WCE return remove(filename); +#else + return !DeleteFile(filename); +#endif } // Rename a file. int cfile_rename(char *oldname, char *newname) { +#ifndef _WIN32_WCE return rename(oldname, newname); +#else + return !MoveFile(oldname, newname); +#endif } // Make a directory. int cfile_mkdir(char *pathname) { -#if defined(__WINDOWS__) || defined(__MINGW32__) - return mkdir(pathname); +#ifdef _WIN32 +# ifdef _WIN32_WCE + return !CreateDirectory(pathname, NULL); +# else + return _mkdir(pathname); +# endif #else - return mkdir(pathname, 0755); + return mkdir(pathname, 0755) #endif } diff --git a/console/CON_console.c b/console/CON_console.c index 9a5ac426..7960173e 100644 --- a/console/CON_console.c +++ b/console/CON_console.c @@ -700,6 +700,10 @@ void DrawCommandLine() { #endif } +#ifdef _MSC_VER +# define vsnprintf _vsnprintf +#endif + /* Outputs text to the console (in game), up to CON_CHARS_PER_LINE chars can be entered */ void CON_Out(ConsoleInformation *console, const char *str, ...) { va_list marker; @@ -907,7 +911,7 @@ void CON_SetPrompt(ConsoleInformation *console, char* newprompt) { //check length so we can still see at least 1 char :-) if(strlen(newprompt) < console->VChars) - console->Prompt = strdup(newprompt); + console->Prompt = d_strdup(newprompt); else CON_Out(console, "prompt too long. (max. %i chars)", console->VChars - 1); } @@ -948,7 +952,7 @@ void CON_TabCompletion(ConsoleInformation *console) { if(!console) return; - command = strdup(console->LCommand); + command = d_strdup(console->LCommand); command = console->TabFunction(command); if(!command) diff --git a/include/d_io.h b/include/d_io.h index 91cb938a..b9fcc1e7 100644 --- a/include/d_io.h +++ b/include/d_io.h @@ -3,24 +3,22 @@ #ifndef _D_IO_H #define _D_IO_H -#ifdef __WINDOWS__ +#ifndef _WIN32_WCE +#if _WIN32 #include #else #include #endif +#endif extern long ffilelength(FILE *fh); +#if 0 extern long filelength(int fd); +#endif unsigned long d_getdiskfree(); // remove extension from filename, doesn't work with paths. void removeext(const char *filename, char *out); unsigned long GetDiskFree(); -#if defined(__WINDOWS__) || defined(__MINGW32__) -#define d_mkdir(path) mkdir(path) -#else -#define d_mkdir(path) mkdir(path, 0755) -#endif - #endif diff --git a/include/error.h b/include/error.h index 755c2c22..0bdb8a9b 100644 --- a/include/error.h +++ b/include/error.h @@ -1,4 +1,4 @@ -/* $Id: error.h,v 1.9 2003-04-12 00:11:46 btb Exp $ */ +/* $Id: error.h,v 1.10 2003-11-26 12:26:28 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -81,12 +81,14 @@ void Assert(int expr); void Int3(); #ifndef NDEBUG //macros for debugging -#ifdef __GNUC__ #ifdef NO_ASM -//#define Int3() Error("int 3 %s:%i\n",__FILE__,__LINE__); -//#define Int3() {volatile int a=0,b=1/a;} -#define Int3() ((void)0) -#else +//# define Int3() Error("int 3 %s:%i\n",__FILE__,__LINE__); +//# define Int3() {volatile int a=0,b=1/a;} +# define Int3() ((void)0) + +#else // NO_ASM + +#ifdef __GNUC__ #ifdef SDL_INPUT #include #endif @@ -101,17 +103,24 @@ static inline void _Int3() } } #define Int3() _Int3() -#endif #elif defined __WATCOMC__ void Int3(void); //generate int3 #pragma aux Int3 = "int 3h"; + #elif defined _MSC_VER -#define Int3() __asm { int 3 } +static __inline void _Int3() +{ + __asm { int 3 } +} +#define Int3() _Int3() + #else #error Unknown Compiler! #endif +#endif // NO_ASM + #define Assert(expr) ((expr)?(void)0:(void)_Assert(0,#expr,__FILE__,__LINE__)) #ifdef __GNUC__ diff --git a/include/pstypes.h b/include/pstypes.h index ef266447..2a1579b1 100644 --- a/include/pstypes.h +++ b/include/pstypes.h @@ -1,4 +1,4 @@ -/* $Id: pstypes.h,v 1.20 2003-10-04 03:14:47 btb Exp $ */ +/* $Id: pstypes.h,v 1.21 2003-11-26 12:26:28 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -42,7 +42,21 @@ typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong; #endif +#if defined(__APPLE__) && defined(__MACH__) +typedef unsigned long ulong; +#endif + +#include +typedef Sint16 int16_t; +typedef Sint32 int32_t; +typedef Sint64 int64_t; +typedef Uint16 u_int16_t; +typedef Uint32 u_int32_t; +typedef Uint64 u_int64_t; +#ifdef _MSC_VER +# include // this is where min and max are defined +#endif #ifndef min #define min(a,b) (((a)>(b))?(b):(a)) #endif @@ -50,34 +64,22 @@ typedef unsigned long ulong; #define max(a,b) (((a)<(b))?(b):(a)) #endif -#if defined __MINGW32__ -#include -typedef uint64_t u_int64_t; -typedef uint32_t u_int32_t; -typedef uint16_t u_int16_t; +#ifdef _MSC_VER +# define PATH_MAX _MAX_PATH +#endif -#elif defined __unix__ +#ifdef _WIN32_WCE +# define _MAX_DIR 256 +#endif + +#ifdef __unix__ # include # define _MAX_PATH 1024 # define _MAX_DIR 256 -# if defined(__APPLE__) && defined(__MACH__) -typedef unsigned long ulong; -# endif -# ifdef __sun__ -typedef uint64_t u_int64_t; -typedef uint32_t u_int32_t; -typedef uint16_t u_int16_t; -# endif - #elif defined __DJGPP__ # include # define _MAX_PATH 255 # define _MAX_DIR 63 -typedef signed int int32_t; -typedef unsigned int u_int32_t; -typedef signed short int16_t; -typedef unsigned short u_int16_t; - #endif #ifndef __cplusplus @@ -93,8 +95,20 @@ typedef ubyte bool; // and since this file is included everywhere, it's here. #ifdef __GNUC__ # define __pack__ __attribute__((packed)) -#else +#elif defined(_MSC_VER) +# pragma pack(push, packing) +# pragma pack(1) # define __pack__ +#else +# error d2x will not work without packed structures +#endif + +#ifdef _MSC_VER +# define inline __inline +#endif + +#ifndef PACKAGE_STRING +# define PACKAGE_STRING "d2x" #endif #endif //_TYPES_H diff --git a/include/strutil.h b/include/strutil.h index 1cd64b07..596f82f0 100644 --- a/include/strutil.h +++ b/include/strutil.h @@ -1,4 +1,4 @@ -/* $ Id: $ */ +/* $Id: strutil.h,v 1.9 2003-11-26 12:26:28 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -8,10 +8,10 @@ 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. +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_H #define _STRUTILS_H @@ -24,13 +24,23 @@ extern int stricmp(char *str1, char *str2); extern int strnicmp(char *str1, char *str2, int n); #endif -#ifndef __MINGW32__ +#ifdef _WIN32_WCE +# define stricmp _stricmp +# define strnicmp _strnicmp +# define strlwr _strlwr +# define strrev _strrev +#endif + +#ifndef _WIN32 #ifndef __DJGPP__ void strupr( char *s1 ); void strlwr( char *s1 ); #endif void strrev( char *s1 ); +#endif + +#if !defined(__MSDOS__) && !(defined(_WIN32) && !defined(_WIN32_WCE)) void _splitpath(char *name, char *drive, char *path, char *base, char *ext); #endif diff --git a/include/u_dpmi.h b/include/u_dpmi.h index 820343be..d927f88a 100644 --- a/include/u_dpmi.h +++ b/include/u_dpmi.h @@ -1,3 +1,4 @@ +/* $Id: u_dpmi.h,v 1.2 2003-11-26 12:26:28 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -7,51 +8,45 @@ 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. +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/include/u_dpmi.h,v $ - * $Revision: 1.1.1.1 $ - * $Author: bradleyb $ - * $Date: 2001-01-19 03:30:16 $ - * + * * Prototypes for DPMI services. - * - * $Log: not supported by cvs2svn $ - * Revision 1.1.1.1 1999/06/14 22:02:25 donut - * Import of d1x 1.37 source. * + * Old Log: * Revision 1.9 1995/01/14 19:20:14 john * Added function to set a selector's base address. - * + * * Revision 1.8 1994/11/28 20:22:03 john - * Added some variables that return the amount of available + * Added some variables that return the amount of available * memory. - * + * * Revision 1.7 1994/11/15 18:26:38 john * Added verbose flag. - * + * * Revision 1.6 1994/11/07 11:35:05 john * Added prototype for real_free - * + * * Revision 1.5 1994/10/27 19:54:48 john * Added unlock region function,. - * + * * Revision 1.4 1994/09/27 18:27:56 john * Added pragma to make inp,outp,enable,disable intrinsic - * + * * Revision 1.3 1994/09/27 11:54:45 john * Added DPMI init function. - * + * * Revision 1.2 1994/08/24 18:53:51 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 10:22:48 john * Initial revision - * - * + * + * */ #ifndef _DPMI_H @@ -115,12 +110,13 @@ extern int dpmi_modify_selector_base( ushort selector, void * address ); extern int dpmi_modify_selector_limit( ushort selector, int size ); -#ifndef __GNUC__ -// Sets the PM handler. Returns 0 if succssful -extern int dpmi_set_pm_handler(unsigned intnum, void far * isr ); +#if defined(__GNUC__) || defined(_MSC_VER) +# define _far #else -extern int dpmi_set_pm_handler(unsigned intnum, void * isr ); +# define _far far #endif +// Sets the PM handler. Returns 0 if succssful +extern int dpmi_set_pm_handler(unsigned intnum, void _far * isr ); extern unsigned int dpmi_virtual_memory; extern unsigned int dpmi_available_memory; @@ -128,4 +124,3 @@ extern unsigned int dpmi_physical_memory; extern unsigned int dpmi_dos_memory; #endif - diff --git a/libmve/mve_main.c b/libmve/mve_main.c index 241ef3a2..0b68d9d8 100644 --- a/libmve/mve_main.c +++ b/libmve/mve_main.c @@ -1,7 +1,8 @@ -/* $Id: mve_main.c,v 1.5 2003-11-26 03:07:45 btb Exp $ */ +/* $Id: mve_main.c,v 1.6 2003-11-26 12:26:28 btb Exp $ */ #include #include +#include #ifdef _WIN32 # include @@ -15,7 +16,6 @@ #include "libmve.h" - static SDL_Surface *g_screen; #ifdef LANDSCAPE static SDL_Surface *real_screen; @@ -179,6 +179,8 @@ static int pollEvents() switch(event.type) { case SDL_QUIT: + case SDL_MOUSEBUTTONDOWN: + case SDL_MOUSEBUTTONUP: return 1; case SDL_KEYDOWN: switch (event.key.keysym.sym) diff --git a/libmve/mveplay.c b/libmve/mveplay.c index 30bf6da9..b1b8376c 100644 --- a/libmve/mveplay.c +++ b/libmve/mveplay.c @@ -1,4 +1,4 @@ -/* $Id: mveplay.c,v 1.16 2003-11-26 03:07:45 btb Exp $ */ +/* $Id: mveplay.c,v 1.17 2003-11-26 12:26:28 btb Exp $ */ #ifdef HAVE_CONFIG_H #include #endif @@ -102,6 +102,14 @@ static int end_movie_handler(unsigned char major, unsigned char minor, unsigned * timer handlers *************************/ +#ifdef _WIN32_WCE +struct timeval +{ + long tv_sec; + long tv_usec; +}; +#endif + /* * timer variables */ @@ -118,10 +126,6 @@ struct timespec }; #endif -#if defined(HAVE_DECL_NANOSLEEP) && !HAVE_DECL_NANOSLEEP -int nanosleep(struct timespec *ts, void *rem); -#endif - #ifdef _WIN32 int gettimeofday(struct timeval *tv, void *tz) { @@ -138,6 +142,7 @@ int gettimeofday(struct timeval *tv, void *tz) } #endif + static int create_timer_handler(unsigned char major, unsigned char minor, unsigned char *data, int len, void *context) { @@ -525,7 +530,7 @@ static int init_video_handler(unsigned char major, unsigned char minor, unsigned short width, height; if (video_initialized) - return 1; + return 1; /* maybe we actually need to change width/height here? */ else video_initialized = 1; diff --git a/main/cntrlcen.c b/main/cntrlcen.c index 6b636d20..56b954c2 100644 --- a/main/cntrlcen.c +++ b/main/cntrlcen.c @@ -1,4 +1,4 @@ -/* $Id: cntrlcen.c,v 1.13 2003-10-12 09:38:48 btb Exp $ */ +/* $Id: cntrlcen.c,v 1.14 2003-11-26 12:26:29 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -109,7 +109,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -static char rcsid[] = "$Id: cntrlcen.c,v 1.13 2003-10-12 09:38:48 btb Exp $"; +static char rcsid[] = "$Id: cntrlcen.c,v 1.14 2003-11-26 12:26:29 btb Exp $"; #endif #ifdef WINDOWS @@ -118,7 +118,9 @@ static char rcsid[] = "$Id: cntrlcen.c,v 1.13 2003-10-12 09:38:48 btb Exp $"; #include #include +#ifndef _WIN32 #include +#endif #include "pstypes.h" #include "error.h" diff --git a/main/gameseq.c b/main/gameseq.c index e6af89db..41bf1073 100644 --- a/main/gameseq.c +++ b/main/gameseq.c @@ -1,4 +1,4 @@ -/* $Id: gameseq.c,v 1.32 2003-10-21 09:50:56 schaffner Exp $ */ +/* $Id: gameseq.c,v 1.33 2003-11-26 12:26:30 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -292,7 +292,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -char gameseq_rcsid[] = "$Id: gameseq.c,v 1.32 2003-10-21 09:50:56 schaffner Exp $"; +char gameseq_rcsid[] = "$Id: gameseq.c,v 1.33 2003-11-26 12:26:30 btb Exp $"; #endif #ifdef WINDOWS @@ -303,7 +303,9 @@ char gameseq_rcsid[] = "$Id: gameseq.c,v 1.32 2003-10-21 09:50:56 schaffner Exp #include #include #include +#ifndef _MSC_VER #include +#endif #include #ifdef OGL @@ -991,7 +993,6 @@ try_again: if (text[0]==0) //null string goto try_again; - sprintf( filename, "%s.plr", text ); #if 0 diff --git a/main/movie.c b/main/movie.c index 105302ee..917b2846 100644 --- a/main/movie.c +++ b/main/movie.c @@ -1,4 +1,4 @@ -/* $Id: movie.c,v 1.32 2003-11-07 06:30:06 btb Exp $ */ +/* $Id: movie.c,v 1.33 2003-11-26 12:26:30 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -23,16 +23,20 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -static char rcsid[] = "$Id: movie.c,v 1.32 2003-11-07 06:30:06 btb Exp $"; +static char rcsid[] = "$Id: movie.c,v 1.33 2003-11-26 12:26:30 btb Exp $"; #endif #define DEBUG_LEVEL CON_NORMAL #include +#ifndef _WIN32_WCE #include #include #include +#endif +#ifndef _MSC_VER #include +#endif #include #include "movie.h" diff --git a/main/newdemo.c b/main/newdemo.c index c843ca7f..1b8cc144 100644 --- a/main/newdemo.c +++ b/main/newdemo.c @@ -1,4 +1,4 @@ -/* $Id: newdemo.c,v 1.14 2003-10-04 03:14:47 btb Exp $ */ +/* $Id: newdemo.c,v 1.15 2003-11-26 12:26:31 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -734,7 +734,9 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include #include #include // for memset +#ifndef _WIN32_WCE #include +#endif #include /* for isdigit */ #include #ifdef __unix__ @@ -3670,7 +3672,7 @@ void newdemo_start_recording() Newdemo_state = ND_STATE_RECORDING; outfile = cfopen(DEMO_FILENAME, "wb"); -#ifndef MACINTOSH +#if !defined(MACINTOSH) && !defined(_WIN32_WCE) if (outfile == NULL && errno == ENOENT) { //dir doesn't exist? #else if (outfile == NULL) { //dir doesn't exist and no errno on mac! diff --git a/main/newmenu.c b/main/newmenu.c index c1641527..9bc94e90 100644 --- a/main/newmenu.c +++ b/main/newmenu.c @@ -1,4 +1,4 @@ -/* $Id: newmenu.c,v 1.23 2003-11-25 04:13:05 btb Exp $ */ +/* $Id: newmenu.c,v 1.24 2003-11-26 12:26:31 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -573,7 +573,9 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include #include #include +#ifndef _MSC_VER #include +#endif #include #include "pa_enabl.h" //$$POLY_ACC @@ -3890,28 +3892,3 @@ void nm_wrap_text(char *dbuf, char *sbuf, int line_length) d_free(tbuf); } - - -#ifdef NEWMENU_MOUSE -void newmenu_show_cursor() -{ -#if defined(MACINTOSH) - show_cursor(); -#elif defined(WINDOWS) - ShowCursorW(); -#elif defined(SDL_INPUT) - SDL_ShowCursor(SDL_ENABLE); -#endif -} - -void newmenu_hide_cursor() -{ -#if defined(MACINTOSH) - hide_cursor(); -#elif defined(WINDOWS) - HideCursorW(); -#elif defined(SDL_INPUT) - SDL_ShowCursor(SDL_DISABLE); -#endif -} -#endif diff --git a/main/newmenu.h b/main/newmenu.h index 622f3cf1..9e0841aa 100644 --- a/main/newmenu.h +++ b/main/newmenu.h @@ -1,4 +1,4 @@ -/* $Id: newmenu.h,v 1.5 2003-11-25 04:13:05 btb Exp $ */ +/* $Id: newmenu.h,v 1.6 2003-11-26 12:26:32 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -242,9 +242,23 @@ extern void nm_remap_background(void); #if defined(MACINTOSH) || defined(WINDOWS) || defined(SDL_INPUT) # define NEWMENU_MOUSE -void newmenu_show_cursor(); -void newmenu_hide_cursor(); -void draw_close_box(int x, int y); +#endif + +#ifdef NEWMENU_MOUSE +# if defined(MACINTOSH) +# define newmenu_show_cursor() show_cursor() +# define newmenu_hide_cursor() hide_cursor() +# elif defined(WINDOWS) +# define newmenu_show_cursor() ShowCursorW() +# define newmenu_hide_cursor() HideCursorW() +# elif defined(SDL_INPUT) +# include +# define newmenu_show_cursor() SDL_ShowCursor(SDL_ENABLE) +# define newmenu_hide_cursor() SDL_ShowCursor(SDL_DISABLE) +# else +# define newmenu_show_cursor() +# define newmenu_hide_cursor() +# endif #endif #endif /* _NEWMENU_H */ diff --git a/main/playsave.c b/main/playsave.c index 30931023..fdece877 100644 --- a/main/playsave.c +++ b/main/playsave.c @@ -1,4 +1,4 @@ -/* $Id: playsave.c,v 1.15 2003-08-02 06:45:42 btb Exp $ */ +/* $Id: playsave.c,v 1.16 2003-11-26 12:26:33 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -260,8 +260,12 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include #include +#ifndef _MSC_VER #include +#endif +#ifndef _WIN32_WCE #include +#endif #include "error.h" @@ -302,6 +306,10 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "poly_acc.h" #endif #include "isp.h" +#elif defined(_WIN32_WCE) +# define errno -1 +# define ENOENT -1 +# define strerror(x) "Unknown Error" #endif int get_lifetime_checksum (int a,int b); diff --git a/main/songs.c b/main/songs.c index 00991cd6..609b1cf8 100644 --- a/main/songs.c +++ b/main/songs.c @@ -1,4 +1,4 @@ -/* $Id: songs.c,v 1.9 2003-10-10 09:36:35 btb Exp $ */ +/* $Id: songs.c,v 1.10 2003-11-26 12:26:33 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -58,7 +58,9 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include #include #include +#ifndef _MSC_VER #include +#endif #include "inferno.h" #include "error.h" diff --git a/main/state.c b/main/state.c index 9c983efc..49369801 100644 --- a/main/state.c +++ b/main/state.c @@ -1,4 +1,4 @@ -/* $Id: state.c,v 1.10 2003-10-04 03:14:47 btb Exp $ */ +/* $Id: state.c,v 1.11 2003-11-26 12:26:33 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -242,8 +242,12 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include #include #include +#ifndef _MSC_VER #include +#endif +#ifndef _WIN32_WCE #include +#endif #ifdef MACINTOSH #include #endif @@ -610,6 +614,12 @@ int state_get_restore_file(char * fname, int multi) #define CF_BUF_SIZE 1024 +#ifdef _WIN32_WCE +# define errno -1 +# define strerror(x) "Unknown Error" +#endif + + // ----------------------------------------------------------------------------------- // Imagine if C had a function to copy a file... int copy_file(char *old_file, char *new_file) diff --git a/main/text.c b/main/text.c index 5d9d1e2e..7db70896 100644 --- a/main/text.c +++ b/main/text.c @@ -1,4 +1,4 @@ -/* $Id: text.c,v 1.10 2003-10-10 01:42:59 btb Exp $ */ +/* $Id: text.c,v 1.11 2003-11-26 12:26:33 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -65,7 +65,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -static char rcsid[] = "$Id: text.c,v 1.10 2003-10-10 01:42:59 btb Exp $"; +static char rcsid[] = "$Id: text.c,v 1.11 2003-11-26 12:26:33 btb Exp $"; #endif #include @@ -116,7 +116,9 @@ void decode_text_line(char *p) } } +#ifndef _MSC_VER #include +#endif //load all the text strings for Descent void load_text() { diff --git a/misc/args.c b/misc/args.c index 0e70feae..fc9f8c97 100644 --- a/misc/args.c +++ b/misc/args.c @@ -1,4 +1,4 @@ -/* $Id: args.c,v 1.9 2003-06-16 06:57:34 btb Exp $ */ +/* $Id: args.c,v 1.10 2003-11-26 12:26:33 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -57,7 +57,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -static char rcsid[] = "$Id: args.c,v 1.9 2003-06-16 06:57:34 btb Exp $"; +static char rcsid[] = "$Id: args.c,v 1.10 2003-11-26 12:26:33 btb Exp $"; #endif #include @@ -75,7 +75,7 @@ int FindArg( char * s ) { int i; for (i=0; i #define lseek(a,b,c) _lseek(a,b,c) #endif +#if 0 long filelength(int fd) { long old_pos, size; @@ -32,10 +33,18 @@ long filelength(int fd) { return -1L; return size; } +#endif -long ffilelength(FILE *fh) +long ffilelength(FILE *file) { - return filelength(fileno(fh)); + long old_pos, size; + + if ((old_pos = ftell(file)) == -1 || + fseek(file, 0, SEEK_END) == -1 || + (size = ftell(file)) == -1 || + fseek(file, old_pos, SEEK_SET) == -1) + return -1L; + return size; } diff --git a/misc/strutil.c b/misc/strutil.c index 2378e55c..2dce2657 100644 --- a/misc/strutil.c +++ b/misc/strutil.c @@ -1,4 +1,4 @@ -/* $Id: strutil.c,v 1.8 2003-02-18 20:35:35 btb Exp $ */ +/* $Id: strutil.c,v 1.9 2003-11-26 12:26:36 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -51,7 +51,7 @@ int strnicmp( char *s1, char *s2, int n ) } #endif -#ifndef __MINGW32__ +#ifndef _WIN32 #ifndef __DJGPP__ void strlwr( char *s1 ) { @@ -83,7 +83,9 @@ void strrev( char *s1 ) *t-- = c; } } +#endif +#if !defined(__MSDOS__) && !(defined(_WIN32) && !defined(_WIN32_WCE)) void _splitpath(char *name, char *drive, char *path, char *base, char *ext) { char *s, *p; -- 2.39.2