Configure file, partial 64-bit support

Thanks to @redsaurus we've now got (partial) 64-bit support. The game and sounds dll now compile under x64.

I've also added a simple python configure script (based off of Arancaytar's cburschka/cadence script) to quickly allow changing compilers.
Gone are the days of three different Makefiles!
This commit is contained in:
Sylae Jiendra Corell
2014-06-17 14:36:17 -06:00
parent 8ddb3889d2
commit 0233eed9d0
112 changed files with 81 additions and 246 deletions

View File

@@ -1,17 +1,16 @@
# Project: Blades of Exile Win32
# Makefile created by Dev-C++ 4.9.9.2
include ../.config.vars
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
CPP = $(PREFIX)g++
CC = $(PREFIX)gcc
WINDRES = $(PREFIX)windres
RES = Blades_of_Exile_private.res
OBJ = boe.actions.o boe.main.o boe.combat.o boe.dlgutil.o boe.fields.o boe.fileio.o global.o boe.graphics.o boe.graphutil.o boe.infodlg.o boe.itemdata.o boe.items.o boe.locutils.o boe.monster.o boe.newgraph.o boe.party.o boe.specials.o boe.text.o boe.town.o globvar.o tools/soundtool.o tools/soundvars.o tools/dlogtool.o tools/mathutil.o classes/item.o classes/location.o classes/pc.o $(RES)
LINKOBJ = boe.actions.o boe.main.o boe.combat.o boe.dlgutil.o boe.fields.o boe.fileio.o global.o boe.graphics.o boe.graphutil.o boe.infodlg.o boe.itemdata.o boe.items.o boe.locutils.o boe.monster.o boe.newgraph.o boe.party.o boe.specials.o boe.text.o boe.town.o globvar.o tools/soundtool.o tools/soundvars.o tools/dlogtool.o tools/mathutil.o classes/item.o classes/location.o classes/pc.o $(RES)
LIBS = -mwindows -lwinmm
LIBS = -mwindows -lwinmm -static-libgcc -static-libstdc++
INCS = -I"include"
CXXINCS =
BIN = "Blades of Exile.exe"
CXXFLAGS = $(CXXINCS) -Wall -O2
CXXFLAGS = $(CXXINCS) -Wall -O2 -v
CFLAGS = $(INCS) -O2
RM = rm -f

View File

@@ -1,111 +0,0 @@
# Project: Blades of Exile Win32
# Makefile created by Dev-C++ 4.9.9.2
CPP = amd64-mingw32msvc-g++
CC = amd64-mingw32msvc-gcc
WINDRES = amd64-mingw32msvc-windres
RES = Blades_of_Exile_private.res
OBJ = boe.actions.o boe.main.o boe.combat.o boe.dlgutil.o boe.fields.o boe.fileio.o global.o boe.graphics.o boe.graphutil.o boe.infodlg.o boe.itemdata.o boe.items.o boe.locutils.o boe.monster.o boe.newgraph.o boe.party.o boe.specials.o boe.text.o boe.town.o globvar.o tools/soundtool.o tools/soundvars.o tools/dlogtool.o tools/mathutil.o classes/item.o classes/location.o classes/pc.o $(RES)
LINKOBJ = boe.actions.o boe.main.o boe.combat.o boe.dlgutil.o boe.fields.o boe.fileio.o global.o boe.graphics.o boe.graphutil.o boe.infodlg.o boe.itemdata.o boe.items.o boe.locutils.o boe.monster.o boe.newgraph.o boe.party.o boe.specials.o boe.text.o boe.town.o globvar.o tools/soundtool.o tools/soundvars.o tools/dlogtool.o tools/mathutil.o classes/item.o classes/location.o classes/pc.o $(RES)
LIBS = -mwindows -lwinmm
INCS = -I"include"
CXXINCS =
BIN = "Blades of Exile.exe"
CXXFLAGS = $(CXXINCS) -Wall -O2
CFLAGS = $(INCS) -O2
RM = rm -f
.PHONY: all all-before all-after clean clean-custom
all: all-before "Blades of Exile.exe" all-after
clean: clean-custom
${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CPP) $(LINKOBJ) -o "Blades of Exile.exe" $(LIBS)
boe.actions.o: boe.actions.cpp
$(CPP) -c boe.actions.cpp -o boe.actions.o $(CXXFLAGS)
boe.main.o: boe.main.cpp
$(CPP) -c boe.main.cpp -o boe.main.o $(CXXFLAGS)
boe.combat.o: boe.combat.cpp
$(CPP) -c boe.combat.cpp -o boe.combat.o $(CXXFLAGS)
boe.dlgutil.o: boe.dlgutil.cpp
$(CPP) -c boe.dlgutil.cpp -o boe.dlgutil.o $(CXXFLAGS)
boe.fields.o: boe.fields.cpp
$(CPP) -c boe.fields.cpp -o boe.fields.o $(CXXFLAGS)
boe.fileio.o: boe.fileio.cpp
$(CPP) -c boe.fileio.cpp -o boe.fileio.o $(CXXFLAGS)
global.o: global.cpp
$(CPP) -c global.cpp -o global.o $(CXXFLAGS)
boe.graphics.o: boe.graphics.cpp
$(CPP) -c boe.graphics.cpp -o boe.graphics.o $(CXXFLAGS)
boe.graphutil.o: boe.graphutil.cpp
$(CPP) -c boe.graphutil.cpp -o boe.graphutil.o $(CXXFLAGS)
boe.infodlg.o: boe.infodlg.cpp
$(CPP) -c boe.infodlg.cpp -o boe.infodlg.o $(CXXFLAGS)
boe.itemdata.o: boe.itemdata.cpp
$(CPP) -c boe.itemdata.cpp -o boe.itemdata.o $(CXXFLAGS)
boe.items.o: boe.items.cpp
$(CPP) -c boe.items.cpp -o boe.items.o $(CXXFLAGS)
boe.locutils.o: boe.locutils.cpp
$(CPP) -c boe.locutils.cpp -o boe.locutils.o $(CXXFLAGS)
boe.monster.o: boe.monster.cpp
$(CPP) -c boe.monster.cpp -o boe.monster.o $(CXXFLAGS)
boe.newgraph.o: boe.newgraph.cpp
$(CPP) -c boe.newgraph.cpp -o boe.newgraph.o $(CXXFLAGS)
boe.party.o: boe.party.cpp
$(CPP) -c boe.party.cpp -o boe.party.o $(CXXFLAGS)
boe.specials.o: boe.specials.cpp
$(CPP) -c boe.specials.cpp -o boe.specials.o $(CXXFLAGS)
boe.text.o: boe.text.cpp
$(CPP) -c boe.text.cpp -o boe.text.o $(CXXFLAGS)
boe.town.o: boe.town.cpp
$(CPP) -c boe.town.cpp -o boe.town.o $(CXXFLAGS)
globvar.o: globvar.cpp
$(CPP) -c globvar.cpp -o globvar.o $(CXXFLAGS)
tools/soundtool.o: tools/soundtool.cpp
$(CPP) -c tools/soundtool.cpp -o tools/soundtool.o $(CXXFLAGS)
tools/soundvars.o: tools/soundvars.cpp
$(CPP) -c tools/soundvars.cpp -o tools/soundvars.o $(CXXFLAGS)
tools/dlogtool.o: tools/dlogtool.cpp
$(CPP) -c tools/dlogtool.cpp -o tools/dlogtool.o $(CXXFLAGS)
tools/mathutil.o: tools/mathutil.cpp
$(CPP) -c tools/mathutil.cpp -o tools/mathutil.o $(CXXFLAGS)
classes/item.o: classes/item.cpp
$(CPP) -c classes/item.cpp -o classes/item.o $(CXXFLAGS)
classes/location.o: classes/location.cpp
$(CPP) -c classes/location.cpp -o classes/location.o $(CXXFLAGS)
classes/pc.o: classes/pc.cpp
$(CPP) -c classes/pc.cpp -o classes/pc.o $(CXXFLAGS)
Blades_of_Exile_private.res: Blades_of_Exile_private.rc BLADES.RC GAMEDLOG.RC GAMESTR.RC
$(WINDRES) -i Blades_of_Exile_private.rc --input-format=rc -o Blades_of_Exile_private.res -O coff -D_INCLUDED_RC

View File

@@ -1,111 +0,0 @@
# Project: Blades of Exile Win32
# Makefile created by Dev-C++ 4.9.9.2
CPP = i586-mingw32msvc-g++
CC = i586-mingw32msvc-gcc
WINDRES = i586-mingw32msvc-windres
RES = Blades_of_Exile_private.res
OBJ = boe.actions.o boe.main.o boe.combat.o boe.dlgutil.o boe.fields.o boe.fileio.o global.o boe.graphics.o boe.graphutil.o boe.infodlg.o boe.itemdata.o boe.items.o boe.locutils.o boe.monster.o boe.newgraph.o boe.party.o boe.specials.o boe.text.o boe.town.o globvar.o tools/soundtool.o tools/soundvars.o tools/dlogtool.o tools/mathutil.o classes/item.o classes/location.o classes/pc.o $(RES)
LINKOBJ = boe.actions.o boe.main.o boe.combat.o boe.dlgutil.o boe.fields.o boe.fileio.o global.o boe.graphics.o boe.graphutil.o boe.infodlg.o boe.itemdata.o boe.items.o boe.locutils.o boe.monster.o boe.newgraph.o boe.party.o boe.specials.o boe.text.o boe.town.o globvar.o tools/soundtool.o tools/soundvars.o tools/dlogtool.o tools/mathutil.o classes/item.o classes/location.o classes/pc.o $(RES)
LIBS = -mwindows -lwinmm
INCS = -I"include"
CXXINCS =
BIN = "Blades of Exile.exe"
CXXFLAGS = $(CXXINCS) -Wall -O2
CFLAGS = $(INCS) -O2
RM = rm -f
.PHONY: all all-before all-after clean clean-custom
all: all-before "Blades of Exile.exe" all-after
clean: clean-custom
${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CPP) $(LINKOBJ) -o "Blades of Exile.exe" $(LIBS)
boe.actions.o: boe.actions.cpp
$(CPP) -c boe.actions.cpp -o boe.actions.o $(CXXFLAGS)
boe.main.o: boe.main.cpp
$(CPP) -c boe.main.cpp -o boe.main.o $(CXXFLAGS)
boe.combat.o: boe.combat.cpp
$(CPP) -c boe.combat.cpp -o boe.combat.o $(CXXFLAGS)
boe.dlgutil.o: boe.dlgutil.cpp
$(CPP) -c boe.dlgutil.cpp -o boe.dlgutil.o $(CXXFLAGS)
boe.fields.o: boe.fields.cpp
$(CPP) -c boe.fields.cpp -o boe.fields.o $(CXXFLAGS)
boe.fileio.o: boe.fileio.cpp
$(CPP) -c boe.fileio.cpp -o boe.fileio.o $(CXXFLAGS)
global.o: global.cpp
$(CPP) -c global.cpp -o global.o $(CXXFLAGS)
boe.graphics.o: boe.graphics.cpp
$(CPP) -c boe.graphics.cpp -o boe.graphics.o $(CXXFLAGS)
boe.graphutil.o: boe.graphutil.cpp
$(CPP) -c boe.graphutil.cpp -o boe.graphutil.o $(CXXFLAGS)
boe.infodlg.o: boe.infodlg.cpp
$(CPP) -c boe.infodlg.cpp -o boe.infodlg.o $(CXXFLAGS)
boe.itemdata.o: boe.itemdata.cpp
$(CPP) -c boe.itemdata.cpp -o boe.itemdata.o $(CXXFLAGS)
boe.items.o: boe.items.cpp
$(CPP) -c boe.items.cpp -o boe.items.o $(CXXFLAGS)
boe.locutils.o: boe.locutils.cpp
$(CPP) -c boe.locutils.cpp -o boe.locutils.o $(CXXFLAGS)
boe.monster.o: boe.monster.cpp
$(CPP) -c boe.monster.cpp -o boe.monster.o $(CXXFLAGS)
boe.newgraph.o: boe.newgraph.cpp
$(CPP) -c boe.newgraph.cpp -o boe.newgraph.o $(CXXFLAGS)
boe.party.o: boe.party.cpp
$(CPP) -c boe.party.cpp -o boe.party.o $(CXXFLAGS)
boe.specials.o: boe.specials.cpp
$(CPP) -c boe.specials.cpp -o boe.specials.o $(CXXFLAGS)
boe.text.o: boe.text.cpp
$(CPP) -c boe.text.cpp -o boe.text.o $(CXXFLAGS)
boe.town.o: boe.town.cpp
$(CPP) -c boe.town.cpp -o boe.town.o $(CXXFLAGS)
globvar.o: globvar.cpp
$(CPP) -c globvar.cpp -o globvar.o $(CXXFLAGS)
tools/soundtool.o: tools/soundtool.cpp
$(CPP) -c tools/soundtool.cpp -o tools/soundtool.o $(CXXFLAGS)
tools/soundvars.o: tools/soundvars.cpp
$(CPP) -c tools/soundvars.cpp -o tools/soundvars.o $(CXXFLAGS)
tools/dlogtool.o: tools/dlogtool.cpp
$(CPP) -c tools/dlogtool.cpp -o tools/dlogtool.o $(CXXFLAGS)
tools/mathutil.o: tools/mathutil.cpp
$(CPP) -c tools/mathutil.cpp -o tools/mathutil.o $(CXXFLAGS)
classes/item.o: classes/item.cpp
$(CPP) -c classes/item.cpp -o classes/item.o $(CXXFLAGS)
classes/location.o: classes/location.cpp
$(CPP) -c classes/location.cpp -o classes/location.o $(CXXFLAGS)
classes/pc.o: classes/pc.cpp
$(CPP) -c classes/pc.cpp -o classes/pc.o $(CXXFLAGS)
Blades_of_Exile_private.res: Blades_of_Exile_private.rc BLADES.RC GAMEDLOG.RC GAMESTR.RC
$(WINDRES) -i Blades_of_Exile_private.rc --input-format=rc -o Blades_of_Exile_private.res -O coff -D_INCLUDED_RC

View File

@@ -11,8 +11,8 @@ void button_flash_rect(RECT to_flash);
void handle_menu_spell(short spell_picked,short spell_type) ;
void initiate_outdoor_combat(short i);
void initiate_redraw();
Boolean handle_syskeystroke(UINT wParam,LONG lParam,short *handled);
Boolean handle_keystroke(UINT wParam,LONG lParam);
Boolean handle_syskeystroke(WPARAM wParam,LPARAM lParam,short *handled);
Boolean handle_keystroke(WPARAM wParam,LPARAM lParam);
void menu_activate( short type);
void do_load();
void post_load();

View File

@@ -444,8 +444,8 @@ void start_talk_mode(short m_num,short personality,unsigned char monst_type,shor
20,
mainPtr,(HMENU) 160,(HINSTANCE) store_hInstance,NULL);
store_edit_parent = mainPtr;
old_edit_proc = (WNDPROC) (GetWindowLong(talk_edit_box,GWL_WNDPROC));
SetWindowLong(talk_edit_box,GWL_WNDPROC,(LONG) edit_proc);
old_edit_proc = (WNDPROC) (GetWindowLongPtr(talk_edit_box,GWLP_WNDPROC));
SetWindowLongPtr(talk_edit_box,GWLP_WNDPROC,(LONG_PTR) edit_proc);
SetFocus(talk_edit_box);
}

View File

@@ -1933,7 +1933,7 @@ void build_scen_headers()
0,0,0,0, // 7
mainPtr, // 8
(HMENU) 1, // 9
(HINSTANCE) GetWindowLong(mainPtr, GWL_HINSTANCE), // 10
(HINSTANCE) GetWindowLongPtr(mainPtr, GWLP_HINSTANCE), // 10
NULL); // 11
ListFiles("", listbox);//First list the scenarios under the scenarios folder
@@ -1965,7 +1965,7 @@ void build_scen_headers()
for (i = 0; i < count; i++)
{
SendMessage(listbox,LB_GETTEXT,i,(LONG) (LPSTR) filename2);
SendMessage(listbox,LB_GETTEXT,i,(LONG_PTR) (LPSTR) filename2);
sprintf(filename,"scenarios/%s",filename2);

View File

@@ -306,7 +306,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR, int nCmd
return msg.wParam;
}
long CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;

View File

@@ -10,6 +10,6 @@ void load_cursors();
void change_cursor(POINT where_curs);
void cursor_go();
void cursor_stay();
long CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
#endif

View File

@@ -47,10 +47,10 @@ short item_label_loc[NI];
inline void cd_kill_dc(short which_slot,HDC hdc) { fry_dc(dlgs[which_slot],hdc); }
BOOL CALLBACK dummy_dialog_proc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK dummy_dialog_proc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK fresh_edit_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
long CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
void cd_init_dialogs()
{
@@ -70,7 +70,7 @@ void cd_init_dialogs()
edit_proc = fresh_edit_proc;
}
long CALLBACK fresh_edit_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK fresh_edit_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if(hwnd == talk_edit_box){
switch (message) {
@@ -542,7 +542,7 @@ short cd_create_dialog(short dlog_num, HWND parent)
return 0;
}
BOOL CALLBACK dummy_dialog_proc (HWND hDlg, UINT message, WPARAM, LPARAM)
LRESULT CALLBACK dummy_dialog_proc (HWND hDlg, UINT message, WPARAM, LPARAM)
{
short i,j,k,free_slot = -1,free_item = -1;
int type, flag;
@@ -728,8 +728,8 @@ BOOL CALLBACK dummy_dialog_proc (HWND hDlg, UINT message, WPARAM, LPARAM)
item_rect[free_item].bottom - item_rect[free_item].top,
dlgs[free_slot],(HMENU) 150,(HINSTANCE) store_hInstance,NULL);
store_edit_parent = dlgs[free_slot];
old_edit_proc = (WNDPROC) (GetWindowLong(edit_box,GWL_WNDPROC));
SetWindowLong(edit_box,GWL_WNDPROC,(LONG) edit_proc);
old_edit_proc = (WNDPROC) (GetWindowLongPtr(edit_box,GWLP_WNDPROC));
SetWindowLongPtr(edit_box,GWLP_WNDPROC,(LONG_PTR) edit_proc);
break;
}
win_height = max(win_height, item_rect[free_item].bottom + 28 + 6);

View File

@@ -14,9 +14,9 @@ short cd_create_dialog_parent_num(short dlog_num,short parent);
void cd_init_dialogs();
short cd_create_dialog(short dlog_num,HWND parent) ;
short cd_kill_dialog(short dlog_num,short parent_message);
short cd_process_click(HWND window,POINT the_point, UINT wparam, LONG lparam,short *item);
short cd_process_syskeystroke(HWND window,UINT wparam, LONG lparam,short *item);
short cd_process_keystroke(HWND window,UINT wparam, LONG lparam,short *item);
short cd_process_click(HWND window,POINT the_point, WPARAM wparam, LPARAM lparam,short *item);
short cd_process_syskeystroke(HWND window,WPARAM wparam, LPARAM lparam,short *item);
short cd_process_keystroke(HWND window,WPARAM wparam, LPARAM lparam,short *item);
void cd_attach_key(short dlog_num,short item_num,char key);
void cd_set_pict(short dlog_num, short item_num, short pict_num);
void cd_activate_item(short dlog_num, short item_num, short status);

28
Boesounds DLL/Makefile Normal file
View File

@@ -0,0 +1,28 @@
include ../.config.vars
CPP = $(PREFIX)g++
CC = $(PREFIX)gcc
WINDRES = $(PREFIX)windres
RES = Blades_of_Exile_private.res
INCS = -I"include"
CXXINCS =
BIN = boesounds.dll
CXXFLAGS = $(CXXINCS) -Wall -O2 -g
RM = rm -f
.PHONY: all all-before all-after clean clean-custom
all: all-before boesounds.dll all-after
clean: clean-custom
${RM} dllmain.o $(BIN)
$(BIN): BOESOUNDS.res dllmain.o
$(CPP) -shared -Wl,--dll dllmain.o BOESOUNDS.res -o boesounds.dll
dllmain.o: dllmain.cpp
$(CPP) -c dllmain.cpp -o dllmain.o $(CXXFLAGS)
BOESOUNDS.res: BOESOUNDS.RC
$(WINDRES) -J rc -O coff -i BOESOUNDS.RC -o BOESOUNDS.res

Some files were not shown because too many files have changed in this diff Show More