From 9218c9a4b191a9f260c820f479bc176d3534d1a3 Mon Sep 17 00:00:00 2001 From: Alan Youngblood Date: Mon, 21 Aug 2023 16:45:15 -0400 Subject: [PATCH] Removed Boost libraries from project --- .DS_Store | Bin 8196 -> 10244 bytes CMakeLists.txt | 4 +-- assets/.DS_Store | Bin 6148 -> 6148 bytes assets/maps/kaiju-city-map.tiled-session | 7 +++-- assets/textures/.DS_Store | Bin 6148 -> 6148 bytes src/.DS_Store | Bin 6148 -> 6148 bytes src/ecs/SpriteComponent.h | 18 ++++--------- src/game/Main.cpp | 31 +++++------------------ 8 files changed, 18 insertions(+), 42 deletions(-) diff --git a/.DS_Store b/.DS_Store index e3c315197aa7a055a7c09a87ce1418237900c8cb..8066f493119d17af8c2417d8a891211bd3a46081 100644 GIT binary patch literal 10244 zcmeHMYit}>6+UPDn%yM!*m2Tr8Ye5<(9}4Ioo9{HcKz5oj+;7oo!Cy?xU)Nx^~AF? z+nL#QLKHABA<^&43N(i-oKq5#y5)dut&YiXI ztnErj6^g`+v~%v`oO{px<~w)Jodp2wFKOKXNdS=P$E32BZYx}@pZ%6yQqa;#63HIS ze0L^i7mCX?qlO592!RNJ2!RNJ2!UG#0eWY%OJ2iebdL~-5Qq?1M1buNN%}FF3giNp z{?`mYV&G$_guxOa?L)$OSH`hc4u%B)KUDM-1fV)Se9VQh{9HlA8kthYt*9 z#^8j4{_He<(pLveaT(ns1R?~MBf!q?wXhTNV1Or{-)rmsen9Li*n@*v)6Pnd9fA^{fmAr8Y z7Z2QF)6NCBvrdNj&bR%GN(@6mS95b_*0#-M9paLtxy*;E4aEhyzxeBmi{J`_i_2L} zM_i0lxWfFXgDjMYTqbBkV@JD6uIEr|Ej&by7iftgjjF{yN4?@=g|V{pZZUx62ic-& zxL#M+Z&0eKt*dX48{{?e!l`0#{gBUcUl&Ms z=BAdW_3K+VY`iV8aYk96RdaKBhdDoBo3_($mh_W($IvoGHD_4)Nl!oPWsDE%GfGR9 z>X@#bT51|US0tU*r3Qbv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xhk!jD{F=DtpE94q!rkUNM3mEwZ=Jq zNLcJ$I;t%14WTD5(4f&3A@FV^P{RjIt|6IT{r~@Wd)jEc2!RNJTL=NH9n1`}4{nu1 zZnbX`H6-cx2>sZ_^cJ}EP3Xo{SiAo@o+|8fynjTew%{P+_oo8A1ulJavh&SJ{*V3) Oh|d4f`Tzg?{Qn;z-aWkl delta 411 zcmZn(XmOBWU|?W$DortDU;r^WfEYvza8FDWo2aMAsJ1a+H$S7=WF7&DcqZ%5%Ykw% z40;Ud44Diix%nKeAE$DJ_WCQL55*)a(-?BP!9u>W5MKRfu70p z1>;y4+T_9}GYX|JGqi7*oFSCPxP9_@p+YtB>S{|9BOL`pi&`CpYI8$#9R)Kpv)Wot z4pC)&>!A4ToZP(p&dKS*@{C=Z+l3!6y2f&a0gYy5NMa}jx;KX*1=+<+MOMddL0pWY z0^w$eipieRvP>xsn=_<8GBO>_og6J2!dNgdu~m>6^j*{LVa?UnP)( R5fYFLljC`&$&zDu695J6Yb5{x diff --git a/CMakeLists.txt b/CMakeLists.txt index 03fb21b..f43864b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2) PKG_SEARCH_MODULE(SDL2IMAGE REQUIRED SDL2_image>=2.0.0) PKG_SEARCH_MODULE(SDL2MIXER REQUIRED SDL2_mixer>=2.0.0) #PKG_SEARCH_MODULE(BOOSTFILESYSTEM boost_filesystem >=) -find_package(Boost COMPONENTS system filesystem REQUIRED) +#find_package(Boost COMPONENTS system filesystem REQUIRED) # Point to our own cmake modules list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/sdl2) @@ -27,4 +27,4 @@ file(GLOB_RECURSE CPPSOURCES src/*.cpp) add_executable(${PROJECT_NAME} ${CSOURCES} ${CPPSOURCES}) install(TARGETS ${PROJECT_NAME} DESTINATION bin) -target_link_libraries(${PROJECT_NAME} PUBLIC Boost::system Boost::filesystem PRIVATE /usr/local/lib/libSDL2.dylib /usr/local/lib/libSDL2_image.dylib /usr/local/lib/libSDL2_mixer.dylib) +target_link_libraries(${PROJECT_NAME} PRIVATE /usr/local/lib/libSDL2.dylib /usr/local/lib/libSDL2_image.dylib /usr/local/lib/libSDL2_mixer.dylib) diff --git a/assets/.DS_Store b/assets/.DS_Store index 80beb96060d2497fb31a2ec9fdf4e95a8d4d7e67..0079dd656181db4bbcf2657b5b76210ad325bba3 100644 GIT binary patch delta 173 zcmZoMXffEJ#>C8&xp=ZBlQdgKxx~&c*U4T?GB9QilMFLc)`iL4OwzGyr!X)uurTB@ zBr+5*6zArq7 gnO^>$tjH`fIg&Y!@xbPT%x)|b8#p(!bNuB80Q#^oyZ`_I delta 172 zcmZoMXffEJ#>C9f@@cXrlQi4Tmd*niwv)Y>WMIr3CK+ai)(MllnWSUGr!X)uurTB@ zBr+5*6zArb!Vyo_lxJI7ys05UZ)0ssI2 diff --git a/assets/maps/kaiju-city-map.tiled-session b/assets/maps/kaiju-city-map.tiled-session index 3002db2..2af5542 100644 --- a/assets/maps/kaiju-city-map.tiled-session +++ b/assets/maps/kaiju-city-map.tiled-session @@ -3,7 +3,7 @@ "height": 4300, "width": 2 }, - "activeFile": "", + "activeFile": "kaiju-city-map2.json", "expandedProjectPaths": [ "." ], @@ -56,11 +56,12 @@ "scale": 2, "selectedLayer": 1, "viewCenter": { - "x": 170, + "x": 169.5, "y": 148.25 } }, "kaiju-city-ts.tsj": { + "scaleInDock": 3, "scaleInEditor": 1 }, "kaiju-city.tsj": { @@ -97,9 +98,11 @@ "map.tileWidth": 8, "map.width": 40, "openFiles": [ + "kaiju-city-map2.json" ], "project": "kaiju-city-map.tiled-project", "recentFiles": [ + "kaiju-city-map2.json", "kaiju-city-ts.tsj", "kaiju-city-map.json", "kaiju-city-map.tmj", diff --git a/assets/textures/.DS_Store b/assets/textures/.DS_Store index 406732f9bc2c0742553f6aa85c0f482db0dbf119..c056964f1cbbf82c2283b5966fdb066db3aa8d59 100644 GIT binary patch delta 66 zcmZoMXffE}%%Y;8%D}+D#*oO6%uvFR&rrlroSX0Bl9ZF51Qh3(>VCQ7mdoUH7CAO3 PvztYMF<|o=mIz@0MvoJd delta 66 zcmZoMXffE}%%Z}*l7WGNjUkaCnW2OspP`7MI5*$LB`GIA2`J8yD!+GzyYu997CAO3 PvztYM(O~l$mIz@0IMEUQ diff --git a/src/.DS_Store b/src/.DS_Store index d863c1b19ff9c4e84a7a4238217206fbde299bdc..c2fba20b3e7a01349a8f86be2a3c14035fa041db 100644 GIT binary patch delta 218 zcmZoMXffDO!7@33MP~98mUSvjdl(oP*cg%-@)`0N(ik!s(sT1&T#|C~lYrtJ2lnle z;c=Oq#wy1KWp=SDFd9r=%_?a#Lk6gVnIRRZw-{N^HM50zQ(ccbBFm=0O@zo!Vl#7? y#0ylx!jR68$dJpBifqD?eR31edVozpl1G>Uk)K?~_Koea*N@O_=gmdzlLP?fBtIJf delta 221 zcmZoMXffDO!NPX*ThDMcgrv%}eW=Pl=>j>xhp za1%XDLB>pCGjr&>3sk|vkj{|Ekjs#YY(le^@zd)N6OiN)X53iD$Xe?>xs2@_+XU}k Mpiedzu}=~J04do(%m4rY diff --git a/src/ecs/SpriteComponent.h b/src/ecs/SpriteComponent.h index 8944fdc..bfabd28 100644 --- a/src/ecs/SpriteComponent.h +++ b/src/ecs/SpriteComponent.h @@ -66,21 +66,13 @@ public: spriteType = sType; if(sType == spriteAnimation) { - /*boost::filesystem::path p{argv[0]}; - p = absolute(p).parent_path(); - std::string configPath = "src/config/config.json"; - std::string bps = p.string(); - size_t charPos = bps.find("build"); - bps.erase(charPos,bps.length()); - std::string configurationPath = bps + json;*/ - std::cout << "Project Path: " << Game::projPath << std::endl; std::string fullPath = Game::projPath + json; std::ifstream fin(fullPath); if(fin.fail()){ std::cerr<<"ERROR opening json file: " << json << std::endl; } else if (fin.is_open()){ - printf("Opened a json file\n"); + //printf("Opened a json file\n"); std::ifstream jsonText(json); std::ostringstream tmp; tmp << jsonText.rdbuf(); @@ -88,14 +80,14 @@ public: cJSON * animJson = cJSON_Parse(aJson.c_str()); std::cout << "animJson: " << std::endl; //std::cout << animJson << std::endl; - char * printOut = cJSON_Print(animJson); - std::cout << animJson << std::endl; + //char * printOut = cJSON_Print(animJson); + //std::cout << animJson << std::endl; cJSON * meta = cJSON_GetObjectItem(animJson, "meta"); cJSON * version = cJSON_GetObjectItem(animJson, "version"); cJSON * frameTags = cJSON_GetObjectItem(meta,"frameTags"); int tagsCount = cJSON_GetArraySize(frameTags); - std::cout << "tagsCount: " << tagsCount << std::endl; - std::cout << "version: " << version << std::endl; + //std::cout << "tagsCount: " << tagsCount << std::endl; + //std::cout << "version: " << version << std::endl; const cJSON * aFrame = NULL; const cJSON * aFrames = NULL; aFrames =cJSON_GetObjectItemCaseSensitive(animJson, "frames"); diff --git a/src/game/Main.cpp b/src/game/Main.cpp index cfcff07..c213c45 100644 --- a/src/game/Main.cpp +++ b/src/game/Main.cpp @@ -11,44 +11,30 @@ #include #include #include -#include Game *game = nullptr; int main(int argc, const char * argv[]) { -// printf("Program has started, but not initialized yet.\n"); const int FPS = 60; const int frameDelay = 1000 / FPS; Uint64 frameStart; int frameTime; - boost::filesystem::path p{argv[0]}; - p = absolute(p).parent_path(); -// std::cout << "boost path: " << p << std::endl; // ============================= // Load cJSON config.json file // ============================= -// Starting with Error Checking std::string configPath = "src/config/config.json"; - std::string bps = p.string(); - size_t charPos = bps.find("build"); - bps.erase(charPos,bps.length()); -// std::cout << "Trimmed Boost Path: " << bps << std::endl; - std::string configurationPath = bps + configPath; - //std::string configPath = "/Users/ayoungblood/Projects/KaijuSaveEarth/src/config/config.json"; -// /Users/ayoungblood/Projects/KaijuSaveEarth -// std::string fullPath = p.c_str() + "/" + configPath; + std::string sdlBasePath = SDL_GetBasePath(); + size_t charPosSdl = sdlBasePath.find("build"); + sdlBasePath.erase(charPosSdl,sdlBasePath.length()); + std::string configurationPath = sdlBasePath + configPath; std::ifstream fin(configurationPath); -// std::cout << "Attempting to load: " << configPath << std::endl; - // std::cout << "Current working Dir: " << std::filesystem::current_path() << std::endl; if(!fin.is_open()){ std::cerr<<"ERROR: config.json not found or opened"<valueint; int windowFS = cJSON_GetObjectItem(myJSON, "WindowFullScreen")->valueint; int globalScale = cJSON_GetObjectItem(myJSON, "GlobalScale")->valueint; -/* int windowWidth = 64; - int windowHeight = 64; - int windowFS = 0; - int globalScale = 10;*/ bool isWindowFS; - //std::string windowName = "KaijuSaveEarth"; if (windowFS==0) { isWindowFS = false; @@ -75,9 +56,9 @@ int main(int argc, const char * argv[]) } windowWidth = windowWidth*globalScale; windowHeight = windowHeight*globalScale; - game = new Game(bps); + game = new Game(sdlBasePath); game->init(windowName->valuestring, windowWidth, windowHeight, isWindowFS, globalScale); -// game->init(windowName.c_str(), windowWidth, windowHeight, isWindowFS, globalScale); + // cJSON memory management cJSON_Delete(myJSON);