Removed Boost libraries from project
This commit is contained in:
parent
de3b2dcdb0
commit
9218c9a4b1
@ -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)
|
||||
|
BIN
assets/.DS_Store
vendored
BIN
assets/.DS_Store
vendored
Binary file not shown.
@ -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",
|
||||
|
BIN
assets/textures/.DS_Store
vendored
BIN
assets/textures/.DS_Store
vendored
Binary file not shown.
BIN
src/.DS_Store
vendored
BIN
src/.DS_Store
vendored
Binary file not shown.
@ -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");
|
||||
|
@ -11,44 +11,30 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
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"<<std::endl;
|
||||
} else {
|
||||
printf("config.json loaded successfully.\n");
|
||||
|
||||
std::ifstream jsonText(configurationPath);
|
||||
std::ostringstream tmp;
|
||||
tmp << jsonText.rdbuf();
|
||||
@ -60,12 +46,7 @@ int main(int argc, const char * argv[])
|
||||
int windowHeight = cJSON_GetObjectItem(windowSize, "h")->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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user