- int result, x, y;
- unsigned int w, h;
-
- /*
- * Again, check if there is at least one more argument
- */
- if ( ++i >= argc )
- fgError( "-geometry parameter must be followed by window geometry settings" );
-
- /*
- * Otherwise scan the geometry settings...
- */
- result = sscanf ( argv[i], "%dx%d+%d+%d", &x, &y, &w, &h );
-
- /*
- * Check what we have been supplied with...
- */
- if ( result > 3 )
- fgState.Size.Y = h ;
-
- if ( result > 2 )
- fgState.Size.X = w ;
-
- if( result > 1 )
- {
- if( y < 0 )
- fgState.Position.Y = fgDisplay.ScreenHeight + y - fgState.Size.Y;
- else
- fgState.Position.Y = y;
- }
-
- if( result > 0 )
- {
- if( x < 0 )
- fgState.Position.X = fgDisplay.ScreenWidth + x - fgState.Size.X;
- else
- fgState.Position.X = x;
- }
-
- /*
- * Have both arguments removed
- */
- argv[ i - 1 ] = NULL;
- argv[ i ] = NULL;
- (* pargc) -= 2;
- }