From bfd9314815ec05403e57bb366958f7751241a574 Mon Sep 17 00:00:00 2001 From: hellboy Date: Thu, 18 Feb 2010 22:08:50 +0100 Subject: [PATCH] Added simple support for cmd file input. --- source/cpp/main.cpp | 16 ++++++++++++---- source/cpp/main.h | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/source/cpp/main.cpp b/source/cpp/main.cpp index bbbb9b0..99b95b8 100644 --- a/source/cpp/main.cpp +++ b/source/cpp/main.cpp @@ -19,14 +19,22 @@ int main(int argc, char **argv){ std::vector slides; global_options = new Options; - - // Read options and images from the standart input - // The format of the input is specified in the - { + argc--; argv++; + if( argc <= 0 or !strcmp(*argv,"-") ){ + // Read options and images from the standart input + // The format of the input is specified in the Parser parser(std::cin); parser( global_options, &slides); if(slides.size() == 0) return 0; + }else{ + while(argc > 0){ + Slide * slide = new Slide; + slide->image = new ImageData(*argv); + slides.push_back(slide); + argc--; argv++; + } + } // GLUT initialization - window creation etc. diff --git a/source/cpp/main.h b/source/cpp/main.h index 2f73f37..ab345f4 100644 --- a/source/cpp/main.h +++ b/source/cpp/main.h @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include -- 2.11.4.GIT