From 196752667571b6865fd951521d235ebd6a5932e4 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Fri, 3 May 2013 19:36:40 -0700 Subject: [PATCH] adding command options --- voxel-edit/src/main.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/voxel-edit/src/main.cpp b/voxel-edit/src/main.cpp index 929b696650..7592de00f4 100644 --- a/voxel-edit/src/main.cpp +++ b/voxel-edit/src/main.cpp @@ -7,6 +7,7 @@ // #include +#include VoxelTree myTree; @@ -115,8 +116,20 @@ void addScene(VoxelTree * tree) { int main(int argc, const char * argv[]) { - addScene(&myTree); - myTree.writeToFileV2("voxels.hio2"); + const char* SAY_HELLO = "--sayHello"; + if (cmdOptionExists(argc, argv, SAY_HELLO)) { + printf("I'm just saying hello...\n"); + } + + const char* DONT_CREATE_FILE = "--dontCreateSceneFile"; + bool dontCreateFile = cmdOptionExists(argc, argv, DONT_CREATE_FILE); + if (dontCreateFile) { + printf("You asked us not to create a scene file, so we will not.\n"); + } else { + printf("Creating Scene File...\n"); + addScene(&myTree); + myTree.writeToFileV2("voxels.hio2"); + } return 0; } \ No newline at end of file