Update of /cvsroot/artoolkit/artoolkit/util/calib_distortion
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv12728
Modified Files:
calib_dist.c
Log Message:
Rename some fns for clarity, change Quit to cleanup.
Index: calib_dist.c
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/util/calib_distortion/calib_dist.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** calib_dist.c 3 Oct 2006 21:35:19 -0000 1.16
--- calib_dist.c 6 Aug 2007 02:38:41 -0000 1.17
***************
*** 107,111 ****
static void Keyboard(unsigned char key, int x, int y);
static void Quit(void);
! static void Idle(void);
static void Visibility(int visible);
static void Reshape(int w, int h);
--- 107,111 ----
static void Keyboard(unsigned char key, int x, int y);
static void Quit(void);
! static void mainLoop(void);
static void Visibility(int visible);
static void Reshape(int w, int h);
***************
*** 140,144 ****
// Register GLUT event-handling callbacks.
! // NB: Idle() is registered by Visibility.
glutDisplayFunc(Display);
glutReshapeFunc(Reshape);
--- 140,144 ----
// Register GLUT event-handling callbacks.
! // NB: mainLoop() is registered by Visibility.
glutDisplayFunc(Display);
glutReshapeFunc(Reshape);
***************
*** 236,240 ****
glutPostRedisplay();
} else {
! Quit();
}
}
--- 236,241 ----
glutPostRedisplay();
} else {
! cleanup();
! exit(0);
}
}
***************
*** 248,252 ****
if (gPatt.loop_num == 0) {
// No images with all features identified, so quit.
! Quit();
} else {
// At least one image with all features identified,
--- 249,254 ----
if (gPatt.loop_num == 0) {
// No images with all features identified, so quit.
! cleanup();
! exit(0);
} else {
// At least one image with all features identified,
***************
*** 440,444 ****
}
! static void Quit(void)
{
if (gClipImage) {
--- 442,446 ----
}
! static void cleanup(void)
{
if (gClipImage) {
***************
*** 449,456 ****
if (gWin) glutDestroyWindow(gWin);
arVideoClose();
- exit(0);
}
! static void Idle(void)
{
static int ms_prev;
--- 451,457 ----
if (gWin) glutDestroyWindow(gWin);
arVideoClose();
}
! static void mainLoop(void)
{
static int ms_prev;
***************
*** 459,463 ****
ARUint8 *image;
! // Find out how long since Idle() last ran.
ms = glutGet(GLUT_ELAPSED_TIME);
s_elapsed = (float)(ms - ms_prev) * 0.001;
--- 460,464 ----
ARUint8 *image;
! // Find out how long since mainLoop() last ran.
ms = glutGet(GLUT_ELAPSED_TIME);
s_elapsed = (float)(ms - ms_prev) * 0.001;
***************
*** 482,486 ****
{
if (visible == GLUT_VISIBLE) {
! glutIdleFunc(Idle);
} else {
glutIdleFunc(NULL);
--- 483,487 ----
{
if (visible == GLUT_VISIBLE) {
! glutIdleFunc(mainLoop);
} else {
glutIdleFunc(NULL);
|