From 7ec50ed0438f510d3d1d728b59a5c15330e7cf21 Mon Sep 17 00:00:00 2001 From: galaxyhaxz Date: Fri, 22 Jun 2018 08:36:41 -0500 Subject: [PATCH 1/6] Delete Makefile --- Makefile | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index 904ed10..0000000 --- a/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -# For 32-bit build systems, the executable is just mingw32 -MINGW32 ?= i686-w64-mingw32 -# Used s.t. we can try to use clang to compile code -_CXX ?= g++ - -CXX=$(MINGW32)-$(_CXX) -ifeq ($(MINGW32), "mingw32") - DLLTOOL=dlltool -else - DLLTOOL=$(MINGW32)-dlltool -endif - -# Clang doesn't understand permissive compilation, we need to "fix" invalid -# casts from a pointer type there using -# static_cast(reinterpret_cast(ptr)) -# instead of -# (NEW_TYPE)(ptr) -CXXFLAGS=-std=c++98 -fpermissive -Wno-write-strings -CPPFLAGS=-MMD -MF $*.d -LDLIBS=-lgdi32 -lversion -ldiabloui -lstorm -LDFLAGS=-L./ - -all: devilution.exe - -include 3rdParty/PKWare/objs.mak -include Source/objs.mak - -devilution.exe: $(OBJS) $(PKWARE_OBJS) diabloui.lib storm.lib - $(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS) - -diabloui.lib: diabloui.dll DiabloUI/diabloui_gcc.def - $(DLLTOOL) -d DiabloUI/diabloui_gcc.def -D $< -l $@ - -diabloui.dll: - $(error Please copy diabloui.dll (version 1.09b) here) - -storm.lib: storm.dll 3rdParty/Storm/Source/storm_gcc.def - $(DLLTOOL) -d 3rdParty/Storm/Source/storm_gcc.def -D $< -l $@ - -storm.dll: - $(error Please copy storm.dll (version 1.09b) here) - -clean: - @$(RM) -v $(OBJS) $(OBJS:.o=.d) $(PKWARE_OBJS) $(PKWARE_OBJS:.o=d) storm.lib diabloui.lib - -.PHONY: clean all From 82bc714c653e29dbd583abe527ffb56c6f8db333 Mon Sep 17 00:00:00 2001 From: galaxyhaxz Date: Fri, 22 Jun 2018 08:36:58 -0500 Subject: [PATCH 2/6] Add files via upload --- Makefile | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c51fd7f --- /dev/null +++ b/Makefile @@ -0,0 +1,49 @@ +# mingw32 and mingw64 have different executables +ifdef MINGW32 + CXX=mingw32-g++ + DLLTOOL=dlltool +else + CXX=i686-w64-mingw32-g++ + DLLTOOL=i686-w64-mingw32-dlltool +endif + +# Clang doesn't understand permissive compilation, we need to "fix" invalid +# casts from a pointer type there using +# static_cast(reinterpret_cast(ptr)) +# instead of +# (NEW_TYPE)(ptr) +CXXFLAGS=-fpermissive -Wno-write-strings +CPPFLAGS=-MMD -MF $*.d +LDLIBS=-lgdi32 -lversion -ldiabloui -lstorm +LDFLAGS=-L./ -static-libgcc -mwindows + +all: devilution.exe + +DIABLO_SRC=$(wildcard Source/*.cpp) +OBJS=$(DIABLO_SRC:.cpp=.o) + +PKWARE_SRC=$(wildcard 3rdParty/PKWare/*.cpp) +PKWARE_OBJS=$(PKWARE_SRC:.cpp=.o) + +devilution.exe: $(OBJS) $(PKWARE_OBJS) diabres.o diabloui.lib storm.lib + $(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS) + +diabres.o: Diablo.rc + windres $< $@ + +diabloui.lib: diabloui.dll DiabloUI/diabloui_gcc.def + $(DLLTOOL) -d DiabloUI/diabloui_gcc.def -D $< -l $@ + +diabloui.dll: +# $(error Please copy diabloui.dll (version 1.09[b]) here) + +storm.lib: storm.dll 3rdParty/Storm/Source/storm_gcc.def + $(DLLTOOL) -d 3rdParty/Storm/Source/storm_gcc.def -D $< -l $@ + +storm.dll: +# $(error Please copy storm.dll (version 1.09[b]) here) + +clean: + @$(RM) -v $(OBJS) $(OBJS:.o=.d) $(PKWARE_OBJS) $(PKWARE_OBJS:.o=d) diabres.o storm.lib diabloui.lib + +.PHONY: clean all From e2eb2851ae4792523d83479f757035365a6302f9 Mon Sep 17 00:00:00 2001 From: galaxyhaxz Date: Fri, 22 Jun 2018 08:37:55 -0500 Subject: [PATCH 3/6] Update types.h --- types.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/types.h b/types.h index 8f127a4..f52f9a4 100644 --- a/types.h +++ b/types.h @@ -15,6 +15,12 @@ #include #include +#ifdef __GNUC__ +#include +#endif + +// tell Visual C++ to shut the hell up +#ifdef _MSC_VER #pragma warning (disable : 4309) // truncation of constant value #pragma warning (disable : 4305) // truncation of int #pragma warning (disable : 4018) // signed/unsigned mismatch @@ -24,6 +30,7 @@ #pragma warning (disable : 4244) // conversion loss #pragma warning (disable : 4800) // bool perf #pragma warning (disable : 4146) // negative unsigned +#endif #include "enums.h" #include "structs.h" @@ -38,7 +45,7 @@ // If defined, use copy protection [Default -> Defined] //#define COPYPROT // If defined, don't reload for debuggers [Default -> Undefined] -#define DEBUGGER +//#define DEBUGGER // If defined, don't fry the CPU [Default -> Undefined] #define SLEEP From b0a028a7e825066d8d38ce04c411a8c669a1152f Mon Sep 17 00:00:00 2001 From: galaxyhaxz Date: Fri, 22 Jun 2018 08:38:49 -0500 Subject: [PATCH 4/6] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b05373d..1bc859e 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,8 @@ Building with Visual C++ 5.10 - Open the project workspace `Diablo.dsw` and select `Build Diablo.exe`. This will build all dependencies and only takes a few seconds. Building with MinGW(32/64) -- Ensure that the MinGW binary paths have been added to the command line. -- For MinGW32, navigate to the project root and execute `make MINGW32=mingw32`. The process will take longer than Visual Studio. +- Ensure that the MinGW binary paths have been added to the command line. On Windows, you would usually type: `set PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin` +- For MinGW32, navigate to the project root and execute `make MINGW32=1`. The process will take longer than Visual Studio. - For MinGW64, refer to the respective documentation: [Linux](Support/INSTALL_linux.md) | [Windows](Support/INSTALL_windows.md) | [Mac](Support/INSTALL_mac.md). Note that only x86 systems may be targeted for the time being. Compiling Definitions From 29361f047361a1cb2c5e2b92ea1c900eb943e8e2 Mon Sep 17 00:00:00 2001 From: galaxyhaxz Date: Fri, 22 Jun 2018 08:39:07 -0500 Subject: [PATCH 5/6] Delete objs.mak --- Source/objs.mak | 70 ------------------------------------------------- 1 file changed, 70 deletions(-) delete mode 100644 Source/objs.mak diff --git a/Source/objs.mak b/Source/objs.mak deleted file mode 100644 index 3a7c893..0000000 --- a/Source/objs.mak +++ /dev/null @@ -1,70 +0,0 @@ -OBJS=Source/path.o \ - Source/monster.o \ - Source/engine.o \ - Source/world.o \ - Source/help.o \ - Source/interfac.o \ - Source/effects.o \ - Source/towners.o \ - Source/gendung.o \ - Source/sound.o \ - Source/sha.o \ - Source/dead.o \ - Source/multi.o \ - Source/items.o \ - Source/drlg_l2.o \ - Source/codec.o \ - Source/pfile.o \ - Source/drlg_l4.o \ - Source/gamemenu.o \ - Source/appfat.o \ - Source/error.o \ - Source/restrict.o \ - Source/player.o \ - Source/capture.o \ - Source/mpqapi.o \ - Source/nthread.o \ - Source/setmaps.o \ - Source/trigs.o \ - Source/diablo.o \ - Source/dx.o \ - Source/portal.o \ - Source/msgcmd.o \ - Source/plrmsg.o \ - Source/themes.o \ - Source/control.o \ - Source/doom.o \ - Source/init.o \ - Source/cursor.o \ - Source/debug.o \ - Source/pack.o \ - Source/stores.o \ - Source/msg.o \ - Source/loadsave.o \ - Source/objects.o \ - Source/palette.o \ - Source/quests.o \ - Source/wave.o \ - Source/tmsg.o \ - Source/minitext.o \ - Source/scrollrt.o \ - Source/sync.o \ - Source/missiles.o \ - Source/gmenu.o \ - Source/town.o \ - Source/dthread.o \ - Source/logging.o \ - Source/textdat.o \ - Source/lighting.o \ - Source/automap.o \ - Source/inv.o \ - Source/drlg_l1.o \ - Source/spells.o \ - Source/encrypt.o \ - Source/fault.o \ - Source/track.o \ - Source/movie.o \ - Source/drlg_l3.o \ - Source/mainmenu.o - --include *.d From 7893325dc035267c8c82b1dd9c7d51b82a0b43f6 Mon Sep 17 00:00:00 2001 From: galaxyhaxz Date: Fri, 22 Jun 2018 08:39:21 -0500 Subject: [PATCH 6/6] Delete objs.mak --- 3rdParty/PKWare/objs.mak | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 3rdParty/PKWare/objs.mak diff --git a/3rdParty/PKWare/objs.mak b/3rdParty/PKWare/objs.mak deleted file mode 100644 index b6e34a1..0000000 --- a/3rdParty/PKWare/objs.mak +++ /dev/null @@ -1,4 +0,0 @@ -PKWARE_OBJS=3rdParty/PKWare/explode.o \ - 3rdParty/PKWare/implode.o - --include *.d