Merge 7893325dc0
into 4d2a1e55dd
commit
6e0db789b3
|
@ -1,4 +0,0 @@
|
||||||
PKWARE_OBJS=3rdParty/PKWare/explode.o \
|
|
||||||
3rdParty/PKWare/implode.o
|
|
||||||
|
|
||||||
-include *.d
|
|
35
Makefile
35
Makefile
|
@ -1,13 +1,10 @@
|
||||||
# For 32-bit build systems, the executable is just mingw32
|
# mingw32 and mingw64 have different executables
|
||||||
MINGW32 ?= i686-w64-mingw32
|
ifdef MINGW32
|
||||||
# Used s.t. we can try to use clang to compile code
|
CXX=mingw32-g++
|
||||||
_CXX ?= g++
|
|
||||||
|
|
||||||
CXX=$(MINGW32)-$(_CXX)
|
|
||||||
ifeq ($(MINGW32), "mingw32")
|
|
||||||
DLLTOOL=dlltool
|
DLLTOOL=dlltool
|
||||||
else
|
else
|
||||||
DLLTOOL=$(MINGW32)-dlltool
|
CXX=i686-w64-mingw32-g++
|
||||||
|
DLLTOOL=i686-w64-mingw32-dlltool
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Clang doesn't understand permissive compilation, we need to "fix" invalid
|
# Clang doesn't understand permissive compilation, we need to "fix" invalid
|
||||||
|
@ -15,32 +12,38 @@ endif
|
||||||
# static_cast<NEW_TYPE>(reinterpret_cast<uintptr_t>(ptr))
|
# static_cast<NEW_TYPE>(reinterpret_cast<uintptr_t>(ptr))
|
||||||
# instead of
|
# instead of
|
||||||
# (NEW_TYPE)(ptr)
|
# (NEW_TYPE)(ptr)
|
||||||
CXXFLAGS=-std=c++98 -fpermissive -Wno-write-strings
|
CXXFLAGS=-fpermissive -Wno-write-strings
|
||||||
CPPFLAGS=-MMD -MF $*.d
|
CPPFLAGS=-MMD -MF $*.d
|
||||||
LDLIBS=-lgdi32 -lversion -ldiabloui -lstorm
|
LDLIBS=-lgdi32 -lversion -ldiabloui -lstorm
|
||||||
LDFLAGS=-L./
|
LDFLAGS=-L./ -static-libgcc -mwindows
|
||||||
|
|
||||||
all: devilution.exe
|
all: devilution.exe
|
||||||
|
|
||||||
include 3rdParty/PKWare/objs.mak
|
DIABLO_SRC=$(wildcard Source/*.cpp)
|
||||||
include Source/objs.mak
|
OBJS=$(DIABLO_SRC:.cpp=.o)
|
||||||
|
|
||||||
devilution.exe: $(OBJS) $(PKWARE_OBJS) diabloui.lib storm.lib
|
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)
|
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
||||||
|
|
||||||
|
diabres.o: Diablo.rc
|
||||||
|
windres $< $@
|
||||||
|
|
||||||
diabloui.lib: diabloui.dll DiabloUI/diabloui_gcc.def
|
diabloui.lib: diabloui.dll DiabloUI/diabloui_gcc.def
|
||||||
$(DLLTOOL) -d DiabloUI/diabloui_gcc.def -D $< -l $@
|
$(DLLTOOL) -d DiabloUI/diabloui_gcc.def -D $< -l $@
|
||||||
|
|
||||||
diabloui.dll:
|
diabloui.dll:
|
||||||
$(error Please copy diabloui.dll (version 1.09b) here)
|
# $(error Please copy diabloui.dll (version 1.09[b]) here)
|
||||||
|
|
||||||
storm.lib: storm.dll 3rdParty/Storm/Source/storm_gcc.def
|
storm.lib: storm.dll 3rdParty/Storm/Source/storm_gcc.def
|
||||||
$(DLLTOOL) -d 3rdParty/Storm/Source/storm_gcc.def -D $< -l $@
|
$(DLLTOOL) -d 3rdParty/Storm/Source/storm_gcc.def -D $< -l $@
|
||||||
|
|
||||||
storm.dll:
|
storm.dll:
|
||||||
$(error Please copy storm.dll (version 1.09b) here)
|
# $(error Please copy storm.dll (version 1.09[b]) here)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@$(RM) -v $(OBJS) $(OBJS:.o=.d) $(PKWARE_OBJS) $(PKWARE_OBJS:.o=d) storm.lib diabloui.lib
|
@$(RM) -v $(OBJS) $(OBJS:.o=.d) $(PKWARE_OBJS) $(PKWARE_OBJS:.o=d) diabres.o storm.lib diabloui.lib
|
||||||
|
|
||||||
.PHONY: clean all
|
.PHONY: clean all
|
||||||
|
|
|
@ -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.
|
- 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)
|
Building with MinGW(32/64)
|
||||||
- Ensure that the MinGW binary paths have been added to the command line.
|
- 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=mingw32`. The process will take longer than Visual Studio.
|
- 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.
|
- 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
|
Compiling Definitions
|
||||||
|
|
|
@ -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
|
|
9
types.h
9
types.h
|
@ -15,6 +15,12 @@
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#include <shlobj.h>
|
#include <shlobj.h>
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#include <ctype.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// tell Visual C++ to shut the hell up
|
||||||
|
#ifdef _MSC_VER
|
||||||
#pragma warning (disable : 4309) // truncation of constant value
|
#pragma warning (disable : 4309) // truncation of constant value
|
||||||
#pragma warning (disable : 4305) // truncation of int
|
#pragma warning (disable : 4305) // truncation of int
|
||||||
#pragma warning (disable : 4018) // signed/unsigned mismatch
|
#pragma warning (disable : 4018) // signed/unsigned mismatch
|
||||||
|
@ -24,6 +30,7 @@
|
||||||
#pragma warning (disable : 4244) // conversion loss
|
#pragma warning (disable : 4244) // conversion loss
|
||||||
#pragma warning (disable : 4800) // bool perf
|
#pragma warning (disable : 4800) // bool perf
|
||||||
#pragma warning (disable : 4146) // negative unsigned
|
#pragma warning (disable : 4146) // negative unsigned
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "enums.h"
|
#include "enums.h"
|
||||||
#include "structs.h"
|
#include "structs.h"
|
||||||
|
@ -38,7 +45,7 @@
|
||||||
// If defined, use copy protection [Default -> Defined]
|
// If defined, use copy protection [Default -> Defined]
|
||||||
//#define COPYPROT
|
//#define COPYPROT
|
||||||
// If defined, don't reload for debuggers [Default -> Undefined]
|
// If defined, don't reload for debuggers [Default -> Undefined]
|
||||||
#define DEBUGGER
|
//#define DEBUGGER
|
||||||
// If defined, don't fry the CPU [Default -> Undefined]
|
// If defined, don't fry the CPU [Default -> Undefined]
|
||||||
#define SLEEP
|
#define SLEEP
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue