diff --git a/3rdParty/Storm/Source/storm.dsp b/3rdParty/Storm/Source/Storm.dsp similarity index 52% rename from 3rdParty/Storm/Source/storm.dsp rename to 3rdParty/Storm/Source/Storm.dsp index cd81cfd..0c44a0f 100644 --- a/3rdParty/Storm/Source/storm.dsp +++ b/3rdParty/Storm/Source/Storm.dsp @@ -1,35 +1,34 @@ -# Microsoft Developer Studio Project File - Name="storm" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# Microsoft Developer Studio Project File - Name="Storm" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 -CFG=storm - Win32 Debug +CFG=Storm - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE -!MESSAGE NMAKE /f "storm.mak". +!MESSAGE NMAKE /f "Storm.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE -!MESSAGE NMAKE /f "storm.mak" CFG="storm - Win32 Debug" +!MESSAGE NMAKE /f "Storm.mak" CFG="Storm - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "storm - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "storm - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "Storm - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "Storm - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project -# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe -!IF "$(CFG)" == "storm - Win32 Release" +!IF "$(CFG)" == "Storm - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -41,22 +40,20 @@ RSC=rc.exe # PROP Output_Dir "WinRel" # PROP Intermediate_Dir "WinRel" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STORM_EXPORTS" /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STORM_EXPORTS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # 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 /dll /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 /dll /machine:I386 /def:"Storm.def" -# SUBTRACT LINK32 /pdb:none +# 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 /dll /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 /dll /machine:I386 /def:"storm.def" -!ELSEIF "$(CFG)" == "storm - Win32 Debug" +!ELSEIF "$(CFG)" == "Storm - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 @@ -67,51 +64,29 @@ LINK32=link.exe # PROP Use_Debug_Libraries 1 # PROP Output_Dir "WinDebug" # PROP Intermediate_Dir "WinDebug" -# PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STORM_EXPORTS" /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STORM_EXPORTS" /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # 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 /dll /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 /dll /debug /machine:I386 /def:"Storm.def" /pdbtype:sept -# SUBTRACT LINK32 /pdb:none +# 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 /dll /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 /dll /debug /machine:I386 /def:"storm.def" /pdbtype:sept !ENDIF # Begin Target -# Name "storm - Win32 Release" -# Name "storm - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Name "Storm - Win32 Release" +# Name "Storm - Win32 Debug" # Begin Source File SOURCE=.\storm.cpp # End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\storm.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# Begin Source File - -SOURCE=.\ReadMe.txt -# End Source File # End Target # End Project diff --git a/Diablo.dsp b/Diablo.dsp index 4772edc..74cd930 100644 --- a/Diablo.dsp +++ b/Diablo.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="Diablo" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 @@ -22,7 +22,6 @@ CFG=Diablo - Win32 Debug !MESSAGE # Begin Project -# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -40,13 +39,11 @@ RSC=rc.exe # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Source/WinRel" # PROP Intermediate_Dir "Source/WinRel" -# 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 /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -54,7 +51,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 DiabloUI/WinRel/diabloui.lib 3rdParty/Storm/Source/WinRel/storm.lib kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib version.lib /nologo /subsystem:windows /machine:I386 +# ADD LINK32 DiabloUI/WinRel/DiabloUI.lib 3rdParty/Storm/Source/WinRel/Storm.lib kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib version.lib /nologo /subsystem:windows /machine:I386 !ELSEIF "$(CFG)" == "Diablo - Win32 Debug" @@ -67,13 +64,11 @@ LINK32=link.exe # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Source/WinDebug" # PROP Intermediate_Dir "Source/WinDebug" -# 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 /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -81,7 +76,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 DiabloUI/WinDebug/diabloui.lib 3rdParty/Storm/Source/WinDebug/storm.lib kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib version.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 DiabloUI/WinDebug/DiabloUI.lib 3rdParty/Storm/Source/WinDebug/Storm.lib kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib version.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF @@ -130,10 +125,6 @@ SOURCE=.\Source\diablo.cpp # End Source File # Begin Source File -SOURCE=.\Diablo.rc -# End Source File -# Begin Source File - SOURCE=.\Source\doom.cpp # End Source File # Begin Source File @@ -178,10 +169,6 @@ SOURCE=.\Source\error.cpp # End Source File # Begin Source File -SOURCE=.\3rdParty\PKWare\explode.cpp -# End Source File -# Begin Source File - SOURCE=.\Source\fault.cpp # End Source File # Begin Source File @@ -202,10 +189,6 @@ SOURCE=.\Source\help.cpp # End Source File # Begin Source File -SOURCE=.\3rdParty\PKWare\implode.cpp -# End Source File -# Begin Source File - SOURCE=.\Source\init.cpp # End Source File # Begin Source File @@ -377,6 +360,18 @@ SOURCE=.\Source\wave.cpp SOURCE=.\Source\world.cpp # End Source File # End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\Diablo.ico +# End Source File +# Begin Source File + +SOURCE=.\Diablo.rc +# End Source File +# End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" @@ -385,12 +380,16 @@ SOURCE=.\Source\world.cpp SOURCE=.\resource.h # End Source File # End Group -# Begin Group "Resource Files" +# Begin Group "PKWare" -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File -SOURCE=.\Diablo.ico +SOURCE=.\3rdParty\PKWare\explode.cpp +# End Source File +# Begin Source File + +SOURCE=.\3rdParty\PKWare\implode.cpp # End Source File # End Group # End Target diff --git a/Diablo.dsw b/Diablo.dsw index df0c1f4..014f0ec 100644 --- a/Diablo.dsw +++ b/Diablo.dsw @@ -1,4 +1,4 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 +Microsoft Developer Studio Workspace File, Format Version 5.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### @@ -15,7 +15,7 @@ Package=<4> Project_Dep_Name DiabloUI End Project Dependency Begin Project Dependency - Project_Dep_Name storm + Project_Dep_Name Storm End Project Dependency }}} @@ -33,7 +33,7 @@ Package=<4> ############################################################################### -Project: "storm"=.\3rdParty\Storm\Source\storm.dsp - Package Owner=<4> +Project: "Storm"=.\3rdParty\Storm\Source\Storm.dsp - Package Owner=<4> Package=<5> {{{ diff --git a/Diablo.rc b/Diablo.rc index 376b116..17a0711 100644 --- a/Diablo.rc +++ b/Diablo.rc @@ -7,10 +7,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#define APSTUDIO_HIDDEN_SYMBOLS -#include "windows.h" -#undef APSTUDIO_HIDDEN_SYMBOLS -#include "resource.h" +#include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -31,14 +28,40 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -101 ICON DISCARDABLE "Diablo.ico" +IDI_ICON1 ICON DISCARDABLE "Diablo.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + ///////////////////////////////////////////////////////////////////////////// // // Dialog // -104 DIALOG DISCARDABLE 0, 0, 250, 241 +IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 250, 241 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Direct Draw Error" FONT 8, "MS Sans Serif" @@ -61,7 +84,7 @@ BEGIN -1,7,116,236,18 END -105 DIALOG DISCARDABLE 0, 0, 250, 213 +IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 250, 213 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Out of Memory Error" FONT 8, "MS Sans Serif" @@ -79,7 +102,7 @@ BEGIN LTEXT "For Windows NT:",-1,7,89,236,9 END -106 DIALOG DISCARDABLE 0, 0, 265, 114 +IDD_DIALOG3 DIALOG DISCARDABLE 0, 0, 265, 114 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Data File Error" FONT 8, "MS Sans Serif" @@ -92,7 +115,7 @@ BEGIN LTEXT "unknown file",1000,20,59,210,27 END -107 DIALOG DISCARDABLE 0, 0, 250, 161 +IDD_DIALOG4 DIALOG DISCARDABLE 0, 0, 250, 161 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Direct Draw Error" FONT 8, "MS Sans Serif" @@ -109,7 +132,7 @@ BEGIN -1,7,39,236,18 END -108 DIALOG DISCARDABLE 0, 0, 250, 161 +IDD_DIALOG5 DIALOG DISCARDABLE 0, 0, 250, 161 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Direct Sound Error" FONT 8, "MS Sans Serif" @@ -125,8 +148,8 @@ BEGIN LTEXT "If you continue to have problems with DirectX, please contact Microsoft's Technical Support at:", -1,7,39,236,18 END -/* -109 DIALOG DISCARDABLE 0, 0, 250, 92 + +/* IDD_DIALOG6 DIALOG DISCARDABLE 0, 0, 250, 92 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "System warning" FONT 8, "MS Sans Serif" @@ -139,9 +162,9 @@ BEGIN LTEXT "Press ""OK"" to proceed, otherwise press ""Cancel"" to exit this program.", -1,7,53,236,9 PUSHBUTTON "&Cancel",2,193,71,50,14 -END -*/ -110 DIALOG DISCARDABLE 0, 0, 250, 100 +END */ + +IDD_DIALOG7 DIALOG DISCARDABLE 0, 0, 250, 100 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Out of Disk Space" FONT 8, "MS Sans Serif" @@ -155,7 +178,7 @@ BEGIN -1,7,52,236,18 END -111 DIALOG DISCARDABLE 0, 0, 250, 161 +IDD_DIALOG8 DIALOG DISCARDABLE 0, 0, 250, 161 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Direct Draw Error" FONT 8, "MS Sans Serif" @@ -171,7 +194,7 @@ BEGIN LTEXT "For Windows 95 and Windows NT",-1,7,41,236,9 END -112 DIALOG DISCARDABLE 0, 0, 250, 92 +IDD_DIALOG9 DIALOG DISCARDABLE 0, 0, 250, 92 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Data File Error" FONT 8, "MS Sans Serif" @@ -183,7 +206,7 @@ BEGIN PUSHBUTTON "Exit",2,193,71,50,14 END -113 DIALOG DISCARDABLE 0, 0, 223, 116 +IDD_DIALOG10 DIALOG DISCARDABLE 0, 0, 223, 116 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Windows 2000 Restricted User Advisory" FONT 8, "MS Sans Serif" @@ -197,7 +220,7 @@ BEGIN -1,7,63,209,28 END -114 DIALOG DISCARDABLE 0, 0, 220, 121 +IDD_DIALOG11 DIALOG DISCARDABLE 0, 0, 220, 121 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Read-Only Directory Error" FONT 8, "MS Sans Serif" @@ -210,35 +233,6 @@ BEGIN END -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" - "#include ""windows.h""\r\n" - "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" - "#include ""resource.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -#endif // APSTUDIO_INVOKED - - #ifndef _MAC ///////////////////////////////////////////////////////////////////////////// // diff --git a/DiabloUI/DiabloUI.dsp b/DiabloUI/DiabloUI.dsp index fd0834c..13405ea 100644 --- a/DiabloUI/DiabloUI.dsp +++ b/DiabloUI/DiabloUI.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="DiabloUI" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 @@ -17,12 +17,12 @@ CFG=DiabloUI - Win32 Debug !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "DiabloUI - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "DiabloUI - Win32 Release" (based on\ + "Win32 (x86) Dynamic-Link Library") !MESSAGE "DiabloUI - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project -# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -41,19 +41,18 @@ RSC=rc.exe # PROP Output_Dir "WinRel" # PROP Intermediate_Dir "WinRel" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DIABLOUI_EXPORTS" /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DIABLOUI_EXPORTS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # 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 /dll /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 /dll /machine:I386 /def:"diabloui.def" +# 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 /dll /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 /dll /machine:I386 /def:"diabloui.def" !ELSEIF "$(CFG)" == "DiabloUI - Win32 Debug" @@ -66,22 +65,19 @@ LINK32=link.exe # PROP Use_Debug_Libraries 1 # PROP Output_Dir "WinDebug" # PROP Intermediate_Dir "WinDebug" -# PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DIABLOUI_EXPORTS" /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DIABLOUI_EXPORTS" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # 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 /dll /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 /dll /debug /machine:I386 /def:"diabloui.def" /pdbtype:sept -# SUBTRACT LINK32 /pdb:none +# 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 /dll /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 /dll /debug /machine:I386 /def:"diabloui.def" /pdbtype:sept !ENDIF @@ -89,29 +85,9 @@ LINK32=link.exe # Name "DiabloUI - Win32 Release" # Name "DiabloUI - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File -SOURCE=.\DiabloUI.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\DiabloUI.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# Begin Source File - -SOURCE=.\ReadMe.txt +SOURCE=.\diabloui.cpp # End Source File # End Target # End Project diff --git a/DiabloUI/DiabloUI.cpp b/DiabloUI/diabloui.cpp similarity index 89% rename from DiabloUI/DiabloUI.cpp rename to DiabloUI/diabloui.cpp index de24b4b..34aae83 100644 --- a/DiabloUI/DiabloUI.cpp +++ b/DiabloUI/diabloui.cpp @@ -1,22 +1,15 @@ -// DiabloUI.cpp : Defines the entry point for the DLL application. -// - #include #include -#include -#include -#include -#include #include -#include +#include #include -#include #include #include -#include +#include #include + #include "..\structs.h" -#include "DiabloUI.h" +#include "diabloui.h" BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, diff --git a/DiabloUI/DiabloUI.h b/DiabloUI/diabloui.h similarity index 100% rename from DiabloUI/DiabloUI.h rename to DiabloUI/diabloui.h diff --git a/Makefile b/Makefile index 62dd847..7a93248 100644 --- a/Makefile +++ b/Makefile @@ -6,24 +6,24 @@ PKWARE_OBJ=$(PKWARE_SRC:.cpp=.o) all: devilution.exe -devilution.exe: $(DIABLO_OBJ) $(PKWARE_OBJ) diabloui.lib storm.lib +devilution.exe: $(DIABLO_OBJ) $(PKWARE_OBJ) DiabloUI.lib Storm.lib i686-w64-mingw32-gcc -L./ -o $@ $^ -lgdi32 -lversion -ldiabloui -lstorm %.o: %.cpp i686-w64-mingw32-gcc -c -fpermissive -o $@ $< -diabloui.lib: diabloui.dll DiabloUI/diabloui_gcc.def - i686-w64-mingw32-dlltool -d DiabloUI/diabloui_gcc.def -D diabloui.dll -l diabloui.lib +DiabloUI.lib: DiabloUI.dll DiabloUI/diabloui_gcc.def + i686-w64-mingw32-dlltool -d DiabloUI/diabloui_gcc.def -D DiabloUI.dll -l DiabloUI.lib -diabloui.dll: - echo "Please copy diabloui.dll (version 1.09b) here." +DiabloUI.dll: + echo "Please copy DiabloUI.dll (version 1.09b) here." exit 1 -storm.lib: storm.dll 3rdParty/Storm/Source/storm_gcc.def - i686-w64-mingw32-dlltool -d 3rdParty/Storm/Source/storm_gcc.def -D storm.dll -l storm.lib +Storm.lib: Storm.dll 3rdParty/Storm/Source/storm_gcc.def + i686-w64-mingw32-dlltool -d 3rdParty/Storm/Source/storm_gcc.def -D Storm.dll -l Storm.lib -storm.dll: - echo "Please copy storm.dll (version 1.09b) here." +Storm.dll: + echo "Please copy Storm.dll (version 1.09b) here." exit 1 clean: diff --git a/Source/appfat.cpp b/Source/appfat.cpp index dd9bc96..eaf718c 100644 --- a/Source/appfat.cpp +++ b/Source/appfat.cpp @@ -797,7 +797,7 @@ void __fastcall DiskFreeDlg(char *error) //----- (00401D1D) -------------------------------------------------------- bool __cdecl InsertCDDlg() { - INT_PTR v0; // edi + int v0; // edi ShowCursor(1); v0 = DialogBoxParamA(ghInst, (LPCSTR)0x70, ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)&empty_string); diff --git a/Source/capture.cpp b/Source/capture.cpp index 6d78e36..9aa273e 100644 --- a/Source/capture.cpp +++ b/Source/capture.cpp @@ -23,7 +23,7 @@ void __cdecl CaptureScreen() if ( hObject != (HANDLE)-1 ) { DrawAndBlit(); - IDirectDrawPalette_GetEntries(lpDDPalette, 0, 0, 256, palette); + lpDDPalette->GetEntries(0, 0, 256, palette); RedPalette(palette); dx_lock_mutex(); v4 = CaptureHdr(hObject, 640, 480); @@ -40,7 +40,7 @@ void __cdecl CaptureScreen() if ( !v4 ) DeleteFileA(FileName); Sleep(300); - IDirectDrawPalette_SetEntries(lpDDPalette, 0, 0, 256, palette); + lpDDPalette->SetEntries(0, 0, 256, palette); } } // 40311B: could not find valid save-restore pair for ebx @@ -215,5 +215,5 @@ void __fastcall RedPalette(PALETTEENTRY *pal) red[i].peFlags = 0; } - IDirectDrawPalette_SetEntries(lpDDPalette, 0, 0, 256, red); + lpDDPalette->SetEntries(0, 0, 256, red); } diff --git a/Source/dx.cpp b/Source/dx.cpp index 67e1906..d017a89 100644 --- a/Source/dx.cpp +++ b/Source/dx.cpp @@ -89,7 +89,7 @@ void __fastcall dx_init(HWND hWnd) if ( v3 ) TermDlg(104, v3, "C:\\Src\\Diablo\\Source\\dx.cpp", 149); fullscreen = 1; - v4 = IDirectDraw_SetCooperativeLevel(lpDDInterface, v1, DDSCL_EXCLUSIVE|DDSCL_ALLOWREBOOT|DDSCL_FULLSCREEN); + v4 = lpDDInterface->SetCooperativeLevel(v1, DDSCL_EXCLUSIVE|DDSCL_ALLOWREBOOT|DDSCL_FULLSCREEN); if ( v4 == DDERR_EXCLUSIVEMODEALREADYSET ) { MI_Dummy(0); // v5 @@ -98,11 +98,11 @@ void __fastcall dx_init(HWND hWnd) { TermDlg(104, v4, "C:\\Src\\Diablo\\Source\\dx.cpp", 170); } - if ( IDirectDraw_SetDisplayMode(lpDDInterface, 640, 480, 8) ) + if ( lpDDInterface->SetDisplayMode(640, 480, 8) ) { v6 = GetSystemMetrics(SM_CXSCREEN); v7 = GetSystemMetrics(SM_CYSCREEN); - v8 = IDirectDraw_SetDisplayMode(lpDDInterface, v6, v7, 8); + v8 = lpDDInterface->SetDisplayMode(v6, v7, 8); if ( v8 ) TermDlg(104, v8, "C:\\Src\\Diablo\\Source\\dx.cpp", 183); } @@ -125,16 +125,16 @@ void __cdecl dx_create_back_buffer() DDSURFACEDESC v4; // [esp+Ch] [ebp-70h] DDSCAPS v5; // [esp+78h] [ebp-4h] - v0 = IDirectDrawSurface_GetCaps(lpDDSPrimary, &v5); + v0 = lpDDSPrimary->GetCaps(&v5); if ( v0 ) DDErrDlg(v0, 59, "C:\\Src\\Diablo\\Source\\dx.cpp"); if ( !gbBackBuf ) { v4.dwSize = 108; - v1 = IDirectDrawSurface_Lock(lpDDSPrimary, NULL, &v4, DDLOCK_WRITEONLY|DDLOCK_WAIT, NULL); + v1 = lpDDSPrimary->Lock(NULL, &v4, DDLOCK_WRITEONLY|DDLOCK_WAIT, NULL); if ( !v1 ) { - IDirectDrawSurface_Unlock(lpDDSPrimary, NULL); + lpDDSPrimary->Unlock(NULL); sgpBackBuf = DiabloAllocPtr(0x7B000); return; } @@ -149,10 +149,10 @@ void __cdecl dx_create_back_buffer() v4.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN; v4.dwHeight = 656; v4.ddpfPixelFormat.dwSize = 32; - v2 = IDirectDrawSurface_GetPixelFormat(lpDDSPrimary, &v4.ddpfPixelFormat); + v2 = lpDDSPrimary->GetPixelFormat(&v4.ddpfPixelFormat); if ( v2 ) TermDlg(104, v2, "C:\\Src\\Diablo\\Source\\dx.cpp", 94); - v3 = IDirectDraw_CreateSurface(lpDDInterface, &v4, &lpDDSBackBuf, NULL); + v3 = lpDDInterface->CreateSurface(&v4, &lpDDSBackBuf, NULL); if ( v3 ) TermDlg(104, v3, "C:\\Src\\Diablo\\Source\\dx.cpp", 96); } @@ -168,7 +168,7 @@ void __cdecl dx_create_primary_surface() v1.dwSize = 108; v1.dwFlags = DDSD_CAPS; v1.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - v0 = IDirectDraw_CreateSurface(lpDDInterface, &v1, &lpDDSPrimary, NULL); + v0 = lpDDInterface->CreateSurface(&v1, &lpDDSPrimary, NULL); if ( v0 ) TermDlg(104, v0, "C:\\Src\\Diablo\\Source\\dx.cpp", 109); } @@ -218,7 +218,7 @@ void __cdecl dx_lock_mutex() if ( sgdwLockCount ) goto LABEL_9; v2.dwSize = 108; - v1 = IDirectDrawSurface_Lock(lpDDSBackBuf, NULL, &v2, DDLOCK_WAIT, NULL); + v1 = lpDDSBackBuf->Lock(NULL, &v2, DDLOCK_WAIT, NULL); if ( v1 ) DDErrDlg(v1, 235, "C:\\Src\\Diablo\\Source\\dx.cpp"); v0 = (Screen *)v2.lpSurface; @@ -251,7 +251,7 @@ void __cdecl dx_unlock_mutex() screen_buf_end -= (signed int)v0; if ( !sgpBackBuf ) { - v1 = IDirectDrawSurface_Unlock(lpDDSBackBuf, NULL); + v1 = lpDDSBackBuf->Unlock(NULL); if ( v1 ) DDErrDlg(v1, 273, "C:\\Src\\Diablo\\Source\\dx.cpp"); } @@ -277,7 +277,7 @@ void __cdecl dx_cleanup() } else if ( lpDDSBackBuf ) { - IDirectDrawSurface_Release(lpDDSBackBuf); + lpDDSBackBuf->Release(); lpDDSBackBuf = 0; } sgdwLockCount = 0; @@ -285,17 +285,17 @@ void __cdecl dx_cleanup() LeaveCriticalSection(&sgMemCrit); if ( lpDDSPrimary ) { - IDirectDrawSurface_Release(lpDDSPrimary); + lpDDSPrimary->Release(); lpDDSPrimary = 0; } if ( lpDDPalette ) { - IDirectDrawPalette_Release(lpDDPalette); + lpDDPalette->Release(); lpDDPalette = 0; } if ( lpDDInterface ) { - IDirectDraw_Release(lpDDInterface); + lpDDInterface->Release(); lpDDInterface = 0; } } diff --git a/Source/fault.cpp b/Source/fault.cpp index b0afcb2..802f6ae 100644 --- a/Source/fault.cpp +++ b/Source/fault.cpp @@ -92,11 +92,11 @@ void __fastcall exception_hex_format(char *a1, char a2) { unsigned int v2; // ebp char *v3; // edi - UINT_PTR v4; // ebx + unsigned int v4; // ebx unsigned int v5; // esi char *v6; // eax int v7; // ST04_4 - UINT_PTR v8; // esi + unsigned int v8; // esi unsigned char v9; // al v2 = a2; diff --git a/Source/missiles.cpp b/Source/missiles.cpp index 0e2dddc..9ec61fc 100644 --- a/Source/missiles.cpp +++ b/Source/missiles.cpp @@ -595,7 +595,7 @@ void __fastcall GetDamageAmt(int i, int *mind, int *maxd) *mind = v14; } v16 = maxd; - v5 = 2 * plr[myplr]._pLevel + 40; + v5 = 2 * plr[myplr]._pLevel + 40; // BUG_FIX: 2 * (plr[myplr]._pLevel + 20) + 4 *maxd = v5; if ( v4 <= 0 ) return; @@ -722,7 +722,7 @@ LABEL_43: *mind = v24; } v16 = maxd; - v5 = 2 * plr[myplr]._pLevel + 40; + v5 = 2 * plr[myplr]._pLevel + 40; // BUG_FIX: 2 * (plr[myplr]._pLevel + 20) + 4 *maxd = v5; if ( v4 <= 0 ) return; diff --git a/Source/palette.cpp b/Source/palette.cpp index 0b0e4d3..cae18af 100644 --- a/Source/palette.cpp +++ b/Source/palette.cpp @@ -52,10 +52,10 @@ void __cdecl palette_init() palette_load_gamma(); memcpy(system_palette, orig_palette, 0x400u); LoadSysPal(); - v0 = IDirectDraw_CreatePalette(lpDDInterface, DDPCAPS_ALLOW256|DDPCAPS_8BIT, system_palette, &lpDDPalette, NULL); + v0 = lpDDInterface->CreatePalette(DDPCAPS_ALLOW256|DDPCAPS_8BIT, system_palette, &lpDDPalette, NULL); if ( v0 ) TermDlg(111, v0, "C:\\Src\\Diablo\\Source\\PALETTE.CPP", 143); - v1 = IDirectDrawSurface_SetPalette(lpDDSPrimary, lpDDPalette); + v1 = lpDDSPrimary->SetPalette(lpDDPalette); if ( v1 ) TermDlg(111, v1, "C:\\Src\\Diablo\\Source\\PALETTE.CPP", 146); } @@ -157,8 +157,8 @@ void __fastcall LoadRndLvlPal(int l) void __cdecl ResetPal() { if ( !lpDDSPrimary - || IDirectDrawSurface_IsLost(lpDDSPrimary) != DDERR_SURFACELOST - || !IDirectDrawSurface_Restore(lpDDSPrimary) ) + || lpDDSPrimary->IsLost() != DDERR_SURFACELOST + || !lpDDSPrimary->Restore() ) { SDrawRealizePalette(); } @@ -267,7 +267,7 @@ void __fastcall SetFadeLevel(int fadeval) system_palette[i].peBlue = (fadeval * logical_palette[i].peBlue) >> 8; } Sleep(3); - IDirectDraw_WaitForVerticalBlank(lpDDInterface, DDWAITVB_BLOCKBEGIN, NULL); + lpDDInterface->WaitForVerticalBlank(DDWAITVB_BLOCKBEGIN, NULL); palette_update(); } } diff --git a/Source/pfile.cpp b/Source/pfile.cpp index 7d4384b..7d0c766 100644 --- a/Source/pfile.cpp +++ b/Source/pfile.cpp @@ -189,7 +189,7 @@ void __fastcall pfile_get_save_path(char *pszBuf, int dwBufSize, int save_num) TermMsg("Unable to get save directory"); sprintf(v7, v4, save_num); strcat(v3, v7); - strlwr(v3); + _strlwr(v3); } // 679660: using guessed type char gbMaxPlayers; @@ -431,7 +431,7 @@ char *__fastcall GetSaveDirectory(char *dst, int dst_size, int save_num) TermMsg("Unable to get save directory"); sprintf(path_buf, v4, save_num); strcat(v3, path_buf); - return strlwr(v3); + return _strlwr(v3); } // 679660: using guessed type char gbMaxPlayers; diff --git a/Source/scrollrt.cpp b/Source/scrollrt.cpp index c190f23..778cb2c 100644 --- a/Source/scrollrt.cpp +++ b/Source/scrollrt.cpp @@ -3177,9 +3177,9 @@ void __fastcall DrawMain(int dwHgt, int draw_desc, int draw_hp, int draw_mana, i a4 = dwHgt; if ( window_activated && lpDDSPrimary ) { - if ( IDirectDrawSurface_IsLost(lpDDSPrimary) == DDERR_SURFACELOST ) + if ( lpDDSPrimary->IsLost() == DDERR_SURFACELOST ) { - if ( IDirectDrawSurface_Restore(lpDDSPrimary) ) + if ( lpDDSPrimary->Restore() ) return; ResetPal(); a4 = 480; @@ -3192,7 +3192,7 @@ LABEL_8: while ( 1 ) { DDS_desc.dwSize = 108; - v8 = IDirectDrawSurface_Lock(lpDDSPrimary, NULL, &DDS_desc, DDLOCK_WRITEONLY|DDLOCK_WAIT, NULL); + v8 = lpDDSPrimary->Lock(NULL, &DDS_desc, DDLOCK_WRITEONLY|DDLOCK_WAIT, NULL); if ( !v8 ) break; if ( v7 - GetTickCount() > 5000 ) @@ -3251,7 +3251,7 @@ LABEL_17: } if ( !lpDDSBackBuf ) { - v9 = IDirectDrawSurface_Unlock(lpDDSPrimary, NULL); + v9 = lpDDSPrimary->Unlock(NULL); if ( v9 != DDERR_SURFACELOST ) { if ( v9 ) @@ -3288,10 +3288,10 @@ void __cdecl DrawFPS() if ( framerate > 99 ) framerate = 99; wsprintfA(String, "%2d", framerate); - if ( !IDirectDrawSurface_GetDC(lpDDSPrimary, &hdc) ) + if ( !lpDDSPrimary->GetDC(&hdc) ) { TextOutA(hdc, 0, 400, String, strlen(String)); - IDirectDrawSurface_ReleaseDC(lpDDSPrimary, hdc); + lpDDSPrimary->ReleaseDC(hdc); } } } @@ -3326,7 +3326,7 @@ void __fastcall DoBlitScreen(int dwX, int dwY, int dwWdt, int dwHgt) a4 = GetTickCount(); while ( 1 ) { - error_code = IDirectDrawSurface_BltFast(lpDDSPrimary, v5, v4, lpDDSBackBuf, &Rect, DDBLTFAST_WAIT); + error_code = lpDDSPrimary->BltFast(v5, v4, lpDDSBackBuf, &Rect, DDBLTFAST_WAIT); if ( !error_code ) break; if ( a4 - GetTickCount() <= 5000 ) diff --git a/Source/sound.cpp b/Source/sound.cpp index d8d30f1..752e1bf 100644 --- a/Source/sound.cpp +++ b/Source/sound.cpp @@ -63,10 +63,10 @@ void __fastcall snd_update(bool bStopAll) do { v3 = DSBs[v2]; - if ( v3 && (v1 || IDirectSoundBuffer_GetStatus(v3, &v4) || v4 != DSBSTATUS_PLAYING) ) // FIX_ME: double check + if ( v3 && (v1 || v3->GetStatus(&v4) || v4 != DSBSTATUS_PLAYING) ) // FIX_ME: double check { - IDirectSoundBuffer_Stop(DSBs[v2]); - IDirectSoundBuffer_Release(DSBs[v2]); + DSBs[v2]->Stop(); + DSBs[v2]->Release(); DSBs[v2] = 0; } ++v2; @@ -83,7 +83,7 @@ void __fastcall snd_stop_snd(TSnd *pSnd) { v1 = pSnd->DSB; if ( v1 ) - IDirectSoundBuffer_Stop(v1); + v1->Stop(); } } @@ -97,7 +97,7 @@ bool __fastcall snd_playing(TSnd *pSnd) v3 = (unsigned long)pSnd; if ( pSnd && (v1 = pSnd->DSB) != 0 - && !IDirectSoundBuffer_GetStatus(v1, &v3) ) + && !v1->GetStatus(&v3) ) { result = v3 == DSBSTATUS_PLAYING; } @@ -145,22 +145,14 @@ void __fastcall snd_play_snd(TSnd *pSnd, int lVolume, int lPan) { v7 = -1600; } - IDirectSoundBuffer_SetVolume(v5, v7); - IDirectSoundBuffer_SetPan(v5, lPan); - v8 = IDirectSoundBuffer_Play( - v5, - 0, - 0, - 0); + v5->SetVolume(v7); + v5->SetPan(lPan); + v8 = v5->Play(0, 0, 0); if ( v8 == DSERR_BUFFERLOST ) { //_LOBYTE(v9) = sound_file_reload(v3, v5); if ( sound_file_reload(v3, v5) ) - IDirectSoundBuffer_Play( - v5, - 0, - 0, - 0); + v5->Play(0, 0, 0); } else if ( v8 ) { @@ -195,10 +187,7 @@ IDirectSoundBuffer *__fastcall sound_dup_channel(IDirectSoundBuffer *DSB) return 0; } v2 = &DSBs[(_DWORD)result]; - if ( IDirectSound_DuplicateSoundBuffer( - sglpDS, - DSB, - &DSBs[(_DWORD)result]) ) + if ( sglpDS->DuplicateSoundBuffer(DSB, &DSBs[(_DWORD)result]) ) { return 0; } @@ -223,24 +212,16 @@ bool __fastcall sound_file_reload(TSnd *sound_file, IDirectSoundBuffer *DSB) v2 = DSB; v3 = sound_file; - if ( IDirectSoundBuffer_Restore(DSB) ) + if ( DSB->Restore() ) return 0; v5 = v3->sound_path; v8 = 0; WOpenFile(v5, &a1, 0); WSetFilePointer(a1, v3->offset, 0, 0); - if ( !IDirectSoundBuffer_Lock( - v2, - 0, - v3->len, - &aptr1, - &asize1, - &aptr2, - &asize2, - 0) ) + if ( !v2->Lock(0, v3->len, &aptr1, &asize1, &aptr2, &asize2, 0) ) { WReadFile(a1, (char *)aptr1, asize1); - if ( !IDirectSoundBuffer_Unlock(v2, aptr1, asize1, aptr2, asize2) ) + if ( !v2->Unlock(aptr1, asize1, aptr2, asize2) ) v8 = 1; } WCloseFile(a1); @@ -276,20 +257,11 @@ TSnd *__fastcall sound_file_load(char *path) if ( !ptr ) TermMsg("Invalid sound format on file %s", v4->sound_path); sound_CreateSoundBuffer(v4); - v5 = IDirectSoundBuffer_Lock( - v4->DSB, - 0, - v4->len, - &aptr1, - &asize1, - &aptr2, - &asize2, - 0); - //v7); + v5 = v4->DSB->Lock(0, v4->len, &aptr1, &asize1, &aptr2, &asize2, 0); //v7); if ( v5 ) DSErrDlg(v5, 318, "C:\\Src\\Diablo\\Source\\SOUND.CPP"); memcpy(aptr1, (char *)ptr + v4->offset, asize1); - v6 = IDirectSoundBuffer_Unlock(v4->DSB, aptr1, asize1, aptr2, asize2); + v6 = v4->DSB->Unlock(aptr1, asize1, aptr2, asize2); if ( v6 ) DSErrDlg(v6, 325, "C:\\Src\\Diablo\\Source\\SOUND.CPP"); mem_free_dbg(ptr); @@ -311,11 +283,7 @@ void __fastcall sound_CreateSoundBuffer(TSnd *sound_file) v3.lpwfxFormat = &v1->fmt; v3.dwSize = 20; v3.dwFlags = DSBCAPS_CTRLVOLUME|DSBCAPS_CTRLPAN|DSBCAPS_STATIC; - v2 = IDirectSound_CreateSoundBuffer( - sglpDS, - &v3, - &v1->DSB, - NULL); + v2 = sglpDS->CreateSoundBuffer(&v3, &v1->DSB, NULL); if ( v2 ) DSErrDlg(v2, 282, "C:\\Src\\Diablo\\Source\\SOUND.CPP"); } @@ -332,8 +300,8 @@ void __fastcall sound_file_cleanup(TSnd *sound_file) v2 = sound_file->DSB; if ( v2 ) { - IDirectSoundBuffer_Stop(sound_file->DSB); - IDirectSoundBuffer_Release(v1->DSB); + sound_file->DSB->Stop(); + v1->DSB->Release(); v1->DSB = 0; } mem_free_dbg(v1); @@ -349,7 +317,7 @@ void __fastcall snd_init(HWND hWnd) gbMusicOn = sglMusicVolume > -1600; if ( sound_DirectSoundCreate(NULL, &sglpDS, NULL) ) sglpDS = 0; - if ( sglpDS && !IDirectSound_SetCooperativeLevel(sglpDS, hWnd, DSSCL_EXCLUSIVE) ) + if ( sglpDS && !sglpDS->SetCooperativeLevel(hWnd, DSSCL_EXCLUSIVE) ) sound_create_primary_buffer(0); SVidInitialize(sglpDS); SFileDdaInitialize(sglpDS); @@ -402,18 +370,14 @@ void __fastcall sound_create_primary_buffer(int music_track) memset(&v4, 0, 0x14u); v4.dwSize = 20; v4.dwFlags = DSBCAPS_PRIMARYBUFFER; - v1 = IDirectSound_CreateSoundBuffer( - sglpDS, - &v4, - &sglpDSB, - NULL); + v1 = sglpDS->CreateSoundBuffer(&v4, &sglpDSB, NULL); if ( v1 ) DSErrDlg(v1, 375, "C:\\Src\\Diablo\\Source\\SOUND.CPP"); } if ( sglpDSB ) { v3.dwSize = 96; - v2 = IDirectSound_GetCaps(sglpDS, &v3); + v2 = sglpDS->GetCaps(&v3); if ( v2 ) DSErrDlg(v2, 383, "C:\\Src\\Diablo\\Source\\SOUND.CPP"); if ( !a1 || !LoadWaveFormat((HANDLE)a1, &a2) ) @@ -427,7 +391,7 @@ void __fastcall sound_create_primary_buffer(int music_track) a2.nChannels = 2; a2.nBlockAlign = 2 * a2.wBitsPerSample / 8; // a2.nChannels * x / 8 (BUG_FIX: per MSDN) a2.nAvgBytesPerSec = a2.nSamplesPerSec * a2.nBlockAlign; - IDirectSoundBuffer_SetFormat(sglpDSB, &a2); + sglpDSB->SetFormat(&a2); } } // 69F100: using guessed type int sglpDSB; @@ -469,7 +433,7 @@ void __cdecl sound_cleanup() SFileDdaDestroy(); if ( sglpDS ) { - IDirectSound_Release(sglpDS); + sglpDS->Release(); sglpDS = 0; } if ( gbSndInited ) diff --git a/resource.h b/resource.h index 5665380..eee3824 100644 --- a/resource.h +++ b/resource.h @@ -14,15 +14,14 @@ #define IDD_DIALOG9 112 #define IDD_DIALOG10 113 #define IDD_DIALOG11 114 -#define IDC_STATIC -1 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 131 -#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_RESOURCE_VALUE 103 +#define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 110 +#define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/types.h b/types.h index 1ea3aff..8f127a4 100644 --- a/types.h +++ b/types.h @@ -7,23 +7,19 @@ #include #include -#include -#include -#include -#include #include -#include +#include #include -#include #include #include -#include +#include #include #pragma warning (disable : 4309) // truncation of constant value #pragma warning (disable : 4305) // truncation of int #pragma warning (disable : 4018) // signed/unsigned mismatch #pragma warning (disable : 4700) // used without having been initialized +#pragma warning (disable : 4804) // unsafe use of type 'bool' in operation #pragma warning (disable : 4805) // unsafe bool mix #pragma warning (disable : 4244) // conversion loss #pragma warning (disable : 4800) // bool perf @@ -32,7 +28,7 @@ #include "enums.h" #include "structs.h" -#include "DiabloUI/DiabloUI.h" +#include "DiabloUI/diabloui.h" #include "3rdParty/Storm/Source/storm.h" #include "3rdParty/PKWare/pkware.h"