From a532ad3422a260569fc4fd23e578e1594ea9e55a Mon Sep 17 00:00:00 2001 From: Ben Scott Date: Sun, 14 Jun 2015 19:16:14 -0400 Subject: [PATCH 1/4] Beginnings of a build script for use with GNU make Original commit messages: Makefiles wow such wow compiling wow includes, libraries, frameworks --- build.sh | 51 +++++++ makefile | 43 ++++++ src/tools/graphtool.cpp | 12 +- src/tools/viewdlog.cpp | 287 ---------------------------------------- 4 files changed, 100 insertions(+), 293 deletions(-) create mode 100755 build.sh create mode 100644 makefile delete mode 100644 src/tools/viewdlog.cpp diff --git a/build.sh b/build.sh new file mode 100755 index 00000000..69052538 --- /dev/null +++ b/build.sh @@ -0,0 +1,51 @@ +#!/bin/sh +# cboe build - paul_erdos 2015-06-14 + +SRC=`ls src/*.{cpp,mm} | grep -v '.win' && + ls src/classes/*.cpp | grep -v '.win' && + ls src/dialogxml/*.cpp | grep -v '.win' && + ls src/dialogxml/xml-parser/*.cpp | grep -v '.win' && + ls src/tools/*.{cpp,mm} | grep -v '.win' && + ls src/tools/gzstream/*.cpp | grep -v '.win'` +SRC=`echo $SRC src/pcedit/pc.editors.cpp` + +function usage { + echo "usage: build [-chrw]" +} + +function help { + usage + echo "options: +-b, --build clean targets and compile +-c, --clean clean obj/ directory without compiling +-h, --help this help text +-r, --run runs the build" +} + +function clean { + rm obj/ +} + +function build { + make game "SRC=$SRC" +} + +if [ $# -gt 0 ]; then + while [ "$1" != "" ]; do + case $1 in + -b | --build ) build + exit;; + -c | --clean ) clean;; + -h | --help ) help + exit;; + -r | --run ) run;; + * ) usage + exit 1 + esac + shift + done +else + build +fi + + diff --git a/makefile b/makefile new file mode 100644 index 00000000..d16b4e26 --- /dev/null +++ b/makefile @@ -0,0 +1,43 @@ +# cboe makefile + +CC=g++ +CFLAGS=-ferror-limit=0 -Werror=format -ftemplate-backtrace-limit=0 -Werror=return-type -Werror=parentheses -Werror=dangling-else -isystem/usr/local/Cellar/boost/1.58.0/include -Wfloat-equal -Wno-long-long -std=c++11 -stdlib=libc++ -lc++ +LIBFLAGS = -lboost_filesystem -lboost_system -L/usr/local/Cellar/boost/1.58.0/lib -lobjc -lz -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio -framework Cocoa -framework CoreFoundation -framework OpenGL +CINCLUDES=-Isrc -Isrc/classes -Isrc/dialogxml -Isrc/dialogxml/xml-parser -Isrc/tools -Isrc/tools/gzstream -Isrc/tools/resmgr +SRC= +OBJ=$(SRC:.cpp=.o) +#TGT=CBoE + +LIB=/usr/local/lib + +boost_lib=-lboost_filesystem -lboost_system -L$LIB +boost_include=-I/usr/local/include/boost + +game: + $(CC) $(CFLAGS) $(CINCLUDES) $(SRC) -o obj $(LIBFLAGS) + +#main: $(SRCS) +# $(CC) $(CFLAGS) -c $(SRC) -o objs $(OBJS) $(LIBFLAGS) + +#.cpp.o: +# $(CC) $(CFLAGS) $< -o $@ + +clean: + \rm obj/*.o + +#all: $(SRCS) $(TGT) +# $(CC) $(CPPFLAGS) $(LDFLAGS) -o $(OBJS) $(LIBFLAGS) +#$(TGT): $(OBJS) +# $(CC) $(CPPFLAGS) $(LDFLAGS) -o $(OBJS) $(LIBFLAGS) +# $(CC) $(OBJS) -o $@ + + +#all: clean common mac win unx +#mac: mac_game mac_scen mac_ched +#win: win_game win_scen win_ched +#unx: unx_game unx_scen unx_ched + +#common: $(OBJS) +# $(CPP) $(CPPFLAGS) -o tool $(OBJS) $(LIBFLAGS) + + diff --git a/src/tools/graphtool.cpp b/src/tools/graphtool.cpp index 01401c66..6b3eeda8 100644 --- a/src/tools/graphtool.cpp +++ b/src/tools/graphtool.cpp @@ -728,18 +728,18 @@ class EllipseShape : public sf::Shape { int points; float a, b; public: - explicit EllipseShape(sf::Vector2f size, unsigned int points = 30) : points(points) { + explicit EllipseShape(sf::Vector2f size, std::size_t points = 30) : points(points) { a = size.x / 2.0f; b = size.y / 2.0f; divSz = 2 * pi() / points; update(); } - unsigned int getPointCount() const override { + std::size_t getPointCount() const override { return points; } - sf::Vector2f getPoint(unsigned int i) const override { + sf::Vector2f getPoint(std::size_t i) const override { float t = i * divSz; return sf::Vector2f(a + a*sin(t), b + b*cos(t)); } @@ -752,7 +752,7 @@ class RoundRectShape : public sf::Shape { int points; float w,h,r; public: - RoundRectShape(sf::Vector2f size, float cornerRadius, unsigned int points = 32) : points(points / 4) { + RoundRectShape(sf::Vector2f size, float cornerRadius, std::size_t points = 32) : points(points / 4) { w = size.x; h = size.y; r = cornerRadius; @@ -760,11 +760,11 @@ public: update(); } - unsigned int getPointCount() const override { + std::size_t getPointCount() const override { return points * 4; } - sf::Vector2f getPoint(unsigned int i) const override { + sf::Vector2f getPoint(std::size_t i) const override { const float pi = ::pi(); const float half_pi = 0.5 * pi; float t = i * divSz; diff --git a/src/tools/viewdlog.cpp b/src/tools/viewdlog.cpp deleted file mode 100644 index bc34538a..00000000 --- a/src/tools/viewdlog.cpp +++ /dev/null @@ -1,287 +0,0 @@ -/* - * viewdlog.cpp - * Editor - * - * Created by Celtic Minstrel on 15/04/09. - * - */ - -#include "dlgtool.h" -#include "graphtool.h" -#include "soundtool.h" - -void Initialize(); -void init_dialogs(); -void display_strings(char *text1, char *text2, char *title,short graphic_num,short graphic_type,short parent_num); - -GWorldPtr anim_gworld, talkfaces_gworld, items_gworld, tiny_obj_gworld, pc_gworld, dlog_gworld, monst_gworld[11], ter_gworld[7], small_ter_gworld, fields_gworld, pc_stats_gworld, item_stats_gworld; -ResFileRefNum graphicsRef, soundsRef, boeRef, scenRef, pcRef; -bool All_Done = false; -WindowPtr mainPtr = (WindowPtr) -1; - -int main() -{ - short error; - OSErr err; - MenuHandle cur_menu; - FSSpec spec; - short refNum, localizedRefNum; - CFBundleRef bundle; - //start_time = TickCount(); - - Initialize(); - Point p = {0,0}; - init_graph_tool(NULL,&p); - init_snd_tool(); - -// menu_bar_handle = GetNewMBar(128); -// if (menu_bar_handle == NULL) { -// SysBeep(2); -// ExitToShell(); -// } -// SetMenuBar(menu_bar_handle); -// DisposeHandle(menu_bar_handle); -// -// apple_menu = GetMenuHandle(500); -// file_menu = GetMenuHandle(550); -// reg_menu = GetMenuHandle(600); -// extra_menu = GetMenuHandle(650); -// edit_menu = GetMenuHandle(700); -// items_menu[0] = GetMenuHandle(750); -// items_menu[1] = GetMenuHandle(751); -// items_menu[2] = GetMenuHandle(752); -// items_menu[3] = GetMenuHandle(753); - - //init_fonts(); - -// DrawMenuBar(); - - init_dialogs(); - - - while (!All_Done){ - if(cd_create_dialog_parent_num(8000,0) == -3){ - //printf("Dialog not found.\n"); - display_strings("The dialog id 8000 could not be loaded.", "", "Dialog not found.",23,4,0); - exit(1); - } - cd_attach_key(8000, 4, 24); - //Handle_One_Event(); - cd_run_dialog(); - cd_kill_dialog(8000); - } - - - return 0; -} - -void Initialize(void) -{ - - OSErr error; - unsigned long randSeed; - BitMap screenBits; - FSRef gRef; - - //char cPath[768]; -// CFBundleRef mainBundle=CFBundleGetMainBundle(); -// CFURLRef graphicsURL = CFBundleCopyResourceURL(mainBundle,CFSTR("bladespced.rsrc"),CFSTR(""),NULL); -// CFStringRef graphicsPath = CFURLCopyFileSystemPath(graphicsURL, kCFURLPOSIXPathStyle); -// CFStringGetCString(graphicsPath, cPath, 512, kCFStringEncodingUTF8);// FSPathMakeRef((UInt8*)cPath, &gRef, false); -// error = FSOpenResourceFile(&gRef, 0, NULL, fsRdPerm, &mainRef); -// if (error != noErr) { -// printf("Error! PC Editor resource file not found.\n"); -// ExitToShell(); - // } - { - char *path = "Scenario Editor/Blades of Exile Graphics"; - error = FSPathMakeRef((UInt8*) path, &gRef, false); - if (error != noErr) { - //SysBeep(1); - printf("Error! File Blades of Exile Graphics not found.\n"); - ExitToShell(); - } - error = FSOpenResourceFile(&gRef, 0, NULL, fsRdPerm, &graphicsRef); - } - { - char *path = "Scenario Editor/Blades of Exile Sounds"; - error = FSPathMakeRef((UInt8*) path, &gRef, false); - error = FSOpenResourceFile(&gRef, 0, NULL, fsRdPerm, &soundsRef); - if (error != noErr) { - //SysBeep(1); - printf("Error! File Blades of Exile Sounds not found.\n"); - ExitToShell(); - } - } - { - char *path = "Blades of Exile.app/Contents/Resources/bladesofexile.rsrc"; - error = FSPathMakeRef((UInt8*) path, &gRef, false); - if (error != noErr) { - //SysBeep(1); - printf("Error! Blades of Exile resource not found.\n"); - ExitToShell(); - } - error = FSOpenResourceFile(&gRef, 0, NULL, fsRdPerm, &boeRef); - } - { - char *path = "Blades of Exile Character Editor.app/Contents/Resources/bladespced.rsrc"; - error = FSPathMakeRef((UInt8*) path, &gRef, false); - if (error != noErr) { - //SysBeep(1); - printf("Error! Blades of Exile PC Editor resource not found.\n"); - ExitToShell(); - } - error = FSOpenResourceFile(&gRef, 0, NULL, fsRdPerm, &scenRef); - } - { - char *path = "Scenario Editor/BoE Scenario Editor.app/Contents/Resources/BoEscen.rsrc"; - error = FSPathMakeRef((UInt8*) path, &gRef, false); - if (error != noErr) { - //SysBeep(1); - printf("Error! Blades of Exile Scenario Editor resources not found.\n"); - ExitToShell(); - } - error = FSOpenResourceFile(&gRef, 0, NULL, fsRdPerm, &pcRef); - } - UseResFile(boeRef); -// path = "Scenario Editor/Blades of Exile Sounds"; -// FSPathMakeRef((UInt8*) path, &sRef, false); -// error = FSOpenResourceFile(&sRef, 0, NULL, fsRdPerm, &soundRef); -// if (error != noErr) { -// //SysBeep(1); -// printf("Error! File Blades of Exile Sounds not found.\n"); -// ExitToShell(); -// } - - InitCursor(); - - // - // Make a new window for drawing in, and it must be a color window. - // The window is full screen size, made smaller to make it more visible. - // -// GetQDGlobalsScreenBits(&screenBits); -// Rect windRect = screenBits.bounds; -// InsetRect(&windRect, 63, 34); -// windRect.top = windRect.top + 15; -// windRect.bottom = windRect.bottom + 15; - -// mainPtr = GetNewCWindow(128,NULL,mainPtr); -// ActivateWindow(mainPtr,true); -// SetPort(GetWindowPort(mainPtr)); /* set window to current graf port */ -} - -void display_strings_event_filter (short item_hit)//// -{ - short i; - bool had1 = false, had2 = false; - - switch (item_hit) { - case 1: - toast_dialog(); - break; - } -} - -void display_strings(char *text1, char *text2, char *title,short graphic_num,short graphic_type,short parent_num) -{ - - short item_hit; - short store_which_string_dlog; - - set_cursor(sword_curs); - - // if ((str1a <= 0) || (str1b <= 0)) - // return; - store_which_string_dlog = 970; - if (strlen(title) > 0) - store_which_string_dlog += 2; - if ((text2 != NULL) && (text2[0] != 0)) - store_which_string_dlog++; - cd_create_dialog_parent_num(store_which_string_dlog,parent_num); - - csp(store_which_string_dlog,store_which_string_dlog,graphic_num,graphic_type); - - csit(store_which_string_dlog,4,(char *) text1); - if (text2 != NULL) { - csit(store_which_string_dlog,5,(char *) text2); - } - if (strlen(title) > 0) - csit(store_which_string_dlog,6,title); - csp(store_which_string_dlog,3,graphic_num,graphic_type); - - item_hit = cd_run_dialog(); - cd_kill_dialog(store_which_string_dlog); -} - -void choose_dialog_event_filter(short item_hit){ - static RGBColor black = {0,0,0}, white = {65535,65535,65535}; - switch(item_hit){ - case 3: - short n = cd_retrieve_text_edit_num(8000, 2); - if(n == 8000) break; - printf("Showing dialog %i\n",n); - if(cd_create_dialog_parent_num(n,8000) == -3){ - char msg[100]; - sprintf(msg,"The dialog id %i could not be loaded.",n); - display_strings(msg, "", "Dialog not found.",23,4,0); - return; - } - cd_run_dialog(); - cd_kill_dialog(n); - break; - case 4: - toast_dialog(); - All_Done = true; - break; - case 6: - printf("Switching to BoE resfile.\n"); - cd_set_led_range(8000,6,8,6); - UseResFile(boeRef); - cd_set_bg_pat_num(5); - cd_set_text_clr(white); - break; - case 7: - printf("Switching to PC resfile.\n"); - cd_set_led_range(8000,6,8,7); - UseResFile(pcRef); - cd_set_bg_pat_num(5); - cd_set_text_clr(white); - break; - case 8: - printf("Switching to Scen resfile.\n"); - cd_set_led_range(8000,6,8,8); - UseResFile(scenRef); - cd_set_bg_pat_num(16); - cd_set_text_clr(black); - break; - } -} - -void preview_event_filter(short item_hit){ - toast_dialog(); -} - -void init_dialogs(){ - anim_gworld = load_pict(820); - talkfaces_gworld = load_pict(860); - items_gworld = load_pict(901); - tiny_obj_gworld = load_pict(900); - pc_gworld = load_pict(902); - dlog_gworld = load_pict(850); - for(int i = 0; i < 11; i++) - monst_gworld[i] = load_pict(1100 + i); - for(int i = 0; i < 7; i++) - ter_gworld[i] = load_pict(800 + i); - small_ter_gworld = load_pict(904); - fields_gworld = load_pict(821); - pc_stats_gworld = load_pict(1400); - item_stats_gworld = load_pict(1401); - mixed_gworld = load_pict(903); - cd_init_dialogs(&anim_gworld, &talkfaces_gworld, &items_gworld, &tiny_obj_gworld, &pc_gworld, &dlog_gworld, monst_gworld, ter_gworld, &small_ter_gworld, &fields_gworld, &pc_stats_gworld, &item_stats_gworld, &mixed_gworld, NULL); - cd_register_event_filter(8000,choose_dialog_event_filter); - cd_register_event_filter(970,display_strings_event_filter); - cd_register_event_filter(971,display_strings_event_filter); - cd_register_event_filter(972,display_strings_event_filter); - cd_register_event_filter(973,display_strings_event_filter); - cd_register_default_event_filter(preview_event_filter); -} \ No newline at end of file From f0e6e7ef245261e07194fda7d14730ff26f74a80 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 14 Jun 2015 23:29:20 -0400 Subject: [PATCH 2/4] Get the makefile basically working in producing an executable of the game - tinyprint.hpp was renamed to tinyprint.h to conform to the pattern of the makefile rules --- build.sh | 41 +++++++++---- makefile | 60 ++++++++++++++++--- src/BoE.vsproj/Common/Common.vcxproj | 2 +- src/BoE.vsproj/Common/Common.vcxproj.filters | 2 +- src/BoE.xcodeproj/project.pbxproj | 4 +- src/dialogxml/xml-parser/tinyprint.cpp | 2 +- .../xml-parser/{tinyprint.hpp => tinyprint.h} | 0 src/scenedit/scen.fileio.cpp | 2 +- 8 files changed, 88 insertions(+), 25 deletions(-) rename src/dialogxml/xml-parser/{tinyprint.hpp => tinyprint.h} (100%) diff --git a/build.sh b/build.sh index 69052538..de7a3ec5 100755 --- a/build.sh +++ b/build.sh @@ -1,16 +1,35 @@ #!/bin/sh # cboe build - paul_erdos 2015-06-14 -SRC=`ls src/*.{cpp,mm} | grep -v '.win' && - ls src/classes/*.cpp | grep -v '.win' && - ls src/dialogxml/*.cpp | grep -v '.win' && - ls src/dialogxml/xml-parser/*.cpp | grep -v '.win' && - ls src/tools/*.{cpp,mm} | grep -v '.win' && - ls src/tools/gzstream/*.cpp | grep -v '.win'` -SRC=`echo $SRC src/pcedit/pc.editors.cpp` +COMMON_SRC=` + ls src/classes/*.cpp | grep -v '\.win' | + sed -E 's/es\/([^\/]*)\.cpp$/_\1.o/ ; s/src/obj/' && + ls src/dialogxml/*.cpp | grep -v '\.win' | + sed -E 's/xml\/([^\/]*)\.cpp$/_\1.o/ ; s/src/obj/' && + ls src/dialogxml/xml-parser/*.cpp | grep -v '\.win' | + sed 's/dialogxml\/xml-parser\/// ; s/\.cpp/.o/ ; s/src/obj/' && + ls src/tools/*.{cpp,mm} | grep -v '\.win' | + sed -E 's/\/([^\/]*)\.(cpp|mm)$/_\1.o/ ; s/src/obj/' +` +BOE_SRC=` + ls src/boe.*.{cpp,mm} | grep -v '.win' | + sed -E 's/\.(cpp|mm)$/.o/ ; s/src/obj/' +` +ED_SRC=` + ls src/scenedit/scen.*.{cpp,mm} | grep -v '\.win' | + sed -E 's/scenedit\/// ; s/\.(cpp|mm)$/.o/ ; s/src/obj/' +` +PC_SRC=` + ls src/pcedit/pc.*.{cpp,mm} | grep -v '\.win' | + sed -E 's/pcedit\/// ; s/\.(cpp|mm)$/.o/ ; s/src/obj/' +` +COMMON_SRC=`echo $COMMON_SRC` +BOE_SRC=`echo $BOE_SRC src/pcedit/pc.editors.cpp` +ED_SRC=`echo $ED_SRC` +PC_SRC=`echo $PC_SRC` function usage { - echo "usage: build [-chrw]" + echo "usage: $0 [-chrw]" } function help { @@ -23,11 +42,13 @@ function help { } function clean { - rm obj/ + rm -rf obj/ exe/ } function build { - make game "SRC=$SRC" + mkdir -p obj exe + echo "$COMMON_SRC" > test.txt + make game "COMMON_SRC=$COMMON_SRC" "BOE_SRC=$BOE_SRC" } if [ $# -gt 0 ]; then diff --git a/makefile b/makefile index d16b4e26..5755224a 100644 --- a/makefile +++ b/makefile @@ -1,20 +1,62 @@ -# cboe makefile +# oboe makefile -CC=g++ -CFLAGS=-ferror-limit=0 -Werror=format -ftemplate-backtrace-limit=0 -Werror=return-type -Werror=parentheses -Werror=dangling-else -isystem/usr/local/Cellar/boost/1.58.0/include -Wfloat-equal -Wno-long-long -std=c++11 -stdlib=libc++ -lc++ -LIBFLAGS = -lboost_filesystem -lboost_system -L/usr/local/Cellar/boost/1.58.0/lib -lobjc -lz -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio -framework Cocoa -framework CoreFoundation -framework OpenGL +CC=clang++ +CFLAGS=-ferror-limit=0 -Werror=format -ftemplate-backtrace-limit=0 -Werror=return-type -Werror=parentheses -Werror=dangling-else -isystem/usr/local/Cellar/boost/1.58.0/include -Wfloat-equal -Wno-long-long -std=c++11 -stdlib=libc++ +LIBFLAGS = -lboost_filesystem -lboost_system -L/usr/local/Cellar/boost/1.58.0/lib -lobjc -lz -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio -lc++ -framework Cocoa -framework CoreFoundation -framework OpenGL CINCLUDES=-Isrc -Isrc/classes -Isrc/dialogxml -Isrc/dialogxml/xml-parser -Isrc/tools -Isrc/tools/gzstream -Isrc/tools/resmgr -SRC= -OBJ=$(SRC:.cpp=.o) -#TGT=CBoE LIB=/usr/local/lib boost_lib=-lboost_filesystem -lboost_system -L$LIB boost_include=-I/usr/local/include/boost -game: - $(CC) $(CFLAGS) $(CINCLUDES) $(SRC) -o obj $(LIBFLAGS) +obj/gzstream.o: src/tools/gzstream/gzstream.cpp src/tools/gzstream/gzstream.h + $(CC) -c $(CINCLUDES) -o $@ $< $(CFLAGS) + +obj/oldstructs.o: src/oldstructs.cpp src/oldstructs.hpp + $(CC) -c $(CINCLUDES) -o $@ $< $(CFLAGS) + +obj/tools_%.o: src/tools/%.cpp + $(CC) -c $(CINCLUDES) -o $@ $< $(CFLAGS) + +obj/tools_%.o: src/tools/%.mm + $(CC) -c $(CINCLUDES) -o $@ $< $(CFLAGS) + +obj/class_%.o: src/classes/%.cpp + $(CC) -c $(CINCLUDES) -o $@ $< $(CFLAGS) + +obj/dialog_%.o: src/dialogxml/%.cpp + $(CC) -c $(CINCLUDES) -o $@ $< $(CFLAGS) + +obj/tinyxml%.o: src/dialogxml/xml-parser/tinyxml%.cpp + $(CC) -c $(CINCLUDES) -o $@ $< $(CFLAGS) -DTIXML_USE_TICPP + +obj/ti%.o: src/dialogxml/xml-parser/ti%.cpp src/dialogxml/xml-parser/ti%.h + $(CC) -c $(CINCLUDES) -o $@ $< $(CFLAGS) -DTIXML_USE_TICPP + +obj/boe.%.o: src/boe.%.cpp + $(CC) -c $(CINCLUDES) -o $@ $< $(CFLAGS) + +obj/boe.%.o: src/boe.%.mm + $(CC) -c $(CINCLUDES) -o $@ $< $(CFLAGS) + +obj/pc.%.o: src/pcedit/pc.%.cpp + $(CC) -c $(CINCLUDES) -o $@ $< $(CFLAGS) + +obj/pc.%.o: src/pcedit/pc.%.mm + $(CC) -c $(CINCLUDES) -o $@ $< $(CFLAGS) + +obj/scen.%.o: src/scenedit/scen.%.cpp + $(CC) -c $(CINCLUDES) -o $@ $< $(CFLAGS) + +obj/scen.%.o: src/scenedit/scen.%.mm + $(CC) -c $(CINCLUDES) -o $@ $< $(CFLAGS) + +obj/common.o: obj/gzstream.o obj/oldstructs.o $(COMMON_SRC) + ld -r $^ -o obj/common.o + +game: obj/common.o $(BOE_SRC) + $(CC) $(CFLAGS) $(CINCLUDES) $^ -o exe/boe $(LIBFLAGS) #main: $(SRCS) # $(CC) $(CFLAGS) -c $(SRC) -o objs $(OBJS) $(LIBFLAGS) diff --git a/src/BoE.vsproj/Common/Common.vcxproj b/src/BoE.vsproj/Common/Common.vcxproj index 38902b9c..52d3ecfb 100644 --- a/src/BoE.vsproj/Common/Common.vcxproj +++ b/src/BoE.vsproj/Common/Common.vcxproj @@ -47,7 +47,7 @@ - + diff --git a/src/BoE.vsproj/Common/Common.vcxproj.filters b/src/BoE.vsproj/Common/Common.vcxproj.filters index 61781a52..19974d6f 100644 --- a/src/BoE.vsproj/Common/Common.vcxproj.filters +++ b/src/BoE.vsproj/Common/Common.vcxproj.filters @@ -112,7 +112,7 @@ DialogXML\TinyXML - + DialogXML\TinyXML diff --git a/src/BoE.xcodeproj/project.pbxproj b/src/BoE.xcodeproj/project.pbxproj index 49f73efa..77ca2c04 100755 --- a/src/BoE.xcodeproj/project.pbxproj +++ b/src/BoE.xcodeproj/project.pbxproj @@ -633,7 +633,7 @@ 917B573F100B956C0096C978 /* undo.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = undo.hpp; sourceTree = ""; }; 918D59A718EA513900735B66 /* dialog.keys.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = dialog.keys.hpp; sourceTree = ""; }; 919086DF1A65C8E30071F7A0 /* tinyprint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinyprint.cpp; sourceTree = ""; }; - 919086E11A65D3250071F7A0 /* tinyprint.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = tinyprint.hpp; sourceTree = ""; }; + 919086E11A65D3250071F7A0 /* tinyprint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tinyprint.h; sourceTree = ""; }; 919145FB18E3A32F005CF3A4 /* boe.appleevents.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = boe.appleevents.mm; sourceTree = ""; }; 919145FD18E3C750005CF3A4 /* scrollbar.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = scrollbar.hpp; sourceTree = ""; }; 919145FE18E63B41005CF3A4 /* winutil.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = winutil.hpp; sourceTree = ""; }; @@ -878,7 +878,7 @@ 910BBA2F0FB8C470001E34EA /* ticpprc.h */, 910BBA290FB8C459001E34EA /* tinystr.h */, 910BBA2B0FB8C459001E34EA /* tinyxml.h */, - 919086E11A65D3250071F7A0 /* tinyprint.hpp */, + 919086E11A65D3250071F7A0 /* tinyprint.h */, 919086DF1A65C8E30071F7A0 /* tinyprint.cpp */, ); path = "xml-parser"; diff --git a/src/dialogxml/xml-parser/tinyprint.cpp b/src/dialogxml/xml-parser/tinyprint.cpp index 2e89294e..526b01d3 100644 --- a/src/dialogxml/xml-parser/tinyprint.cpp +++ b/src/dialogxml/xml-parser/tinyprint.cpp @@ -6,7 +6,7 @@ // // -#include "tinyprint.hpp" +#include "tinyprint.h" #include using namespace ticpp; diff --git a/src/dialogxml/xml-parser/tinyprint.hpp b/src/dialogxml/xml-parser/tinyprint.h similarity index 100% rename from src/dialogxml/xml-parser/tinyprint.hpp rename to src/dialogxml/xml-parser/tinyprint.h diff --git a/src/scenedit/scen.fileio.cpp b/src/scenedit/scen.fileio.cpp index 622dd22a..04e3f596 100644 --- a/src/scenedit/scen.fileio.cpp +++ b/src/scenedit/scen.fileio.cpp @@ -17,7 +17,7 @@ #include "dlogutil.hpp" #include "tarball.hpp" #include "gzstream.h" -#include "tinyprint.hpp" +#include "tinyprint.h" #include "map_parse.hpp" #define DONE_BUTTON_ITEM 1 From 14f85cfc72ea52e7bde29dacaff55013461320c2 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Mon, 15 Jun 2015 00:20:54 -0400 Subject: [PATCH 3/4] Makefile targets for editors and for resources (still needs refinement) --- build.sh | 7 ++++-- makefile | 66 +++++++++++++++++++++++++++++++++++--------------------- 2 files changed, 47 insertions(+), 26 deletions(-) diff --git a/build.sh b/build.sh index de7a3ec5..188a3e29 100755 --- a/build.sh +++ b/build.sh @@ -46,9 +46,12 @@ function clean { } function build { - mkdir -p obj exe + mkdir -p obj exe/bin 'exe/Blades of Exile/data' + mkdir -p 'exe/Blades of Exile/Blades of Exile Scenarios/' + mkdir -p 'exe/Blades of Exile/Scenario Editor/Blades of Exile Base' echo "$COMMON_SRC" > test.txt - make game "COMMON_SRC=$COMMON_SRC" "BOE_SRC=$BOE_SRC" + export COMMON_SRC BOE_SRC ED_SRC PC_SRC + make all } if [ $# -gt 0 ]; then diff --git a/makefile b/makefile index 5755224a..a733c435 100644 --- a/makefile +++ b/makefile @@ -10,6 +10,8 @@ LIB=/usr/local/lib boost_lib=-lboost_filesystem -lboost_system -L$LIB boost_include=-I/usr/local/include/boost +all: game pced scened + obj/gzstream.o: src/tools/gzstream/gzstream.cpp src/tools/gzstream/gzstream.h $(CC) -c $(CINCLUDES) -o $@ $< $(CFLAGS) @@ -55,31 +57,47 @@ obj/scen.%.o: src/scenedit/scen.%.mm obj/common.o: obj/gzstream.o obj/oldstructs.o $(COMMON_SRC) ld -r $^ -o obj/common.o -game: obj/common.o $(BOE_SRC) - $(CC) $(CFLAGS) $(CINCLUDES) $^ -o exe/boe $(LIBFLAGS) - -#main: $(SRCS) -# $(CC) $(CFLAGS) -c $(SRC) -o objs $(OBJS) $(LIBFLAGS) +exe/bin/boe: obj/common.o $(BOE_SRC) + $(CC) $(CFLAGS) $(CINCLUDES) $^ -o exe/bin/boe $(LIBFLAGS) -#.cpp.o: -# $(CC) $(CFLAGS) $< -o $@ +exe/bin/pced: obj/common.o $(PC_SRC) + $(CC) $(CFLAGS) $(CINCLUDES) $^ -o exe/bin/pced $(LIBFLAGS) + +exe/bin/scened: obj/common.o $(ED_SRC) + $(CC) $(CFLAGS) $(CINCLUDES) $^ -o exe/bin/scened $(LIBFLAGS) + +game: exe/bin/boe resources + +pced: exe/bin/pced resources + +scened: exe/bin/scened resources + +resources: sounds.exa graphics.exd strings dialogs fonts scenarios shaders + +shaders: src/tools/mask.vert src/tools/mask.frag + mkdir -p 'exe/Blades of Exile/data/shaders' + cp -fp src/tools/mask.* 'exe/Blades of Exile/data/shaders/' + +sounds.exa: + cp -Rfp rsrc/sounds.exa 'exe/Blades of Exile/Scenario Editor/' + +graphics.exd: + cp -Rfp rsrc/graphics.exd 'exe/Blades of Exile/Scenario Editor/' + +strings: + cp -Rfp rsrc/strings/ 'exe/Blades of Exile/data/' + +dialogs: + mkdir -p 'exe/Blades of Exile/data/dialogs' + cp -fp rsrc/dialogs/*.xml 'exe/Blades of Exile/data/dialogs/' + +fonts: + cp -Rfp rsrc/fonts/ 'exe/Blades of Exile/data/' + +scenarios: + cp -fp 'rsrc/Blades of Exile Scenarios'/*.{exs,meg} 'exe/Blades of Exile/Blades of Exile Scenarios/' + cp -fp 'rsrc/Blades of Exile Bases'/*.exs 'exe/Blades of Exile/Scenario Editor/Blades of Exile Base' clean: - \rm obj/*.o - -#all: $(SRCS) $(TGT) -# $(CC) $(CPPFLAGS) $(LDFLAGS) -o $(OBJS) $(LIBFLAGS) -#$(TGT): $(OBJS) -# $(CC) $(CPPFLAGS) $(LDFLAGS) -o $(OBJS) $(LIBFLAGS) -# $(CC) $(OBJS) -o $@ - - -#all: clean common mac win unx -#mac: mac_game mac_scen mac_ched -#win: win_game win_scen win_ched -#unx: unx_game unx_scen unx_ched - -#common: $(OBJS) -# $(CPP) $(CPPFLAGS) -o tool $(OBJS) $(LIBFLAGS) - + rm -rf obj exe/bin From 6b28dbad7cf5718b8f98be87054059f551b44e46 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Mon, 15 Jun 2015 00:21:34 -0400 Subject: [PATCH 4/4] Fix loading wrong nibs for menus --- src/boe.menus.mac.mm | 2 +- src/pcedit/pc.menus.mac.mm | 2 +- src/scenedit/scen.menus.mac.mm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/boe.menus.mac.mm b/src/boe.menus.mac.mm index 53686309..332f36f7 100644 --- a/src/boe.menus.mac.mm +++ b/src/boe.menus.mac.mm @@ -101,7 +101,7 @@ void init_menubar() { if(inited) return; inited = true; NSApplication* app = [NSApplication sharedApplication]; - [NSBundle loadNibNamed: @"menu" owner: app]; + [NSBundle loadNibNamed: @"game" owner: app]; menu_bar_handle = [app mainMenu]; apple_menu = [[menu_bar_handle itemWithTitle: @"Blades of Exile"] submenu]; diff --git a/src/pcedit/pc.menus.mac.mm b/src/pcedit/pc.menus.mac.mm index 28761fd8..b950e2ea 100644 --- a/src/pcedit/pc.menus.mac.mm +++ b/src/pcedit/pc.menus.mac.mm @@ -46,7 +46,7 @@ void init_menubar() { inited = true; NSApplication* app = [NSApplication sharedApplication]; - [NSBundle loadNibNamed: @"pc.menu" owner: app]; + [NSBundle loadNibNamed: @"pcedit" owner: app]; menu_bar_handle = [app mainMenu]; apple_menu = [[menu_bar_handle itemWithTitle: @"BoE Character Editor"] submenu]; diff --git a/src/scenedit/scen.menus.mac.mm b/src/scenedit/scen.menus.mac.mm index a9267fd6..c43c5589 100644 --- a/src/scenedit/scen.menus.mac.mm +++ b/src/scenedit/scen.menus.mac.mm @@ -33,7 +33,7 @@ void init_menubar() { inited = true; NSApplication* app = [NSApplication sharedApplication]; - [NSBundle loadNibNamed: @"scen.menu" owner: app]; + [NSBundle loadNibNamed: @"scenedit" owner: app]; menu_bar_handle = [app mainMenu]; app_menu = [[menu_bar_handle itemWithTitle: @"BoE Scenario Editor"] submenu];