From 05a8962f626a233f1d0a7826b3b3823578db8bfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Pe=C3=B1aranda?= Date: Wed, 23 Jan 2013 14:32:06 -0200 Subject: [PATCH] read max fov from rc file --- openglcanvas.cpp | 10 ++++++++-- openglcanvas.h | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/openglcanvas.cpp b/openglcanvas.cpp index a4544c1..361dd04 100644 --- a/openglcanvas.cpp +++ b/openglcanvas.cpp @@ -38,8 +38,6 @@ OpenGLCanvas::OpenGLCanvas(QWidget *parent) : time_timer.setInterval(0); connect(&time_timer, SIGNAL(timeout()), this, SLOT(slotTimer())); time_start = time_time.time(); - - fprintf(stderr,"scale=%f\nfov_max=%f\n",scale,fov_max); } void OpenGLCanvas::slotTimer(void) { @@ -151,6 +149,7 @@ void OpenGLCanvas::read_config_file(){ shader_dir[0]='\0'; input_image_file=(char*)malloc(512*sizeof(char)); input_image_file[0]='\0'; + char *max_fov_str=(char*)malloc(64*sizeof(char)); struct stat testbuf; if(stat(filepath,&testbuf)){ fprintf(stderr,"~/.panorc does not exist\n"); @@ -180,6 +179,13 @@ void OpenGLCanvas::read_config_file(){ input_image_file[strlen(line)-12]='\0'; fprintf(stderr,"input_image_file=%s\n",input_image_file); } + // check for 'max_fov' option + if(!strncmp(line,"max_fov=",8)){ + strcpy(max_fov_str,line+8); + max_fov_str[strlen(line)-9]='\0'; + fov_max=atof(max_fov_str); + fprintf(stderr,"max_fov=%f\n",fov_max); + } } fclose(rcfile); } diff --git a/openglcanvas.h b/openglcanvas.h index ac854b0..f0e0617 100644 --- a/openglcanvas.h +++ b/openglcanvas.h @@ -95,7 +95,6 @@ private: //float windowWidth; //float windowHeight; - // options set in the rc file char* shader_dir; char* input_image_file; -- GitLab