Optimizations by Norman Vine.
This commit is contained in:
parent
a5e70b27d8
commit
032806000b
3 changed files with 31 additions and 16 deletions
|
@ -511,8 +511,8 @@ void fgOPTIONS::usage ( void ) {
|
||||||
printf("General Options:\n");
|
printf("General Options:\n");
|
||||||
printf("\t--help -h: print usage\n");
|
printf("\t--help -h: print usage\n");
|
||||||
printf("\t--fg-root=path: specify the root path for all the data files\n");
|
printf("\t--fg-root=path: specify the root path for all the data files\n");
|
||||||
printf("\t--disable-gamemode: disable full-screen game mode\n");
|
printf("\t--disable-game-mode: disable full-screen game mode\n");
|
||||||
printf("\t--enable-gamemode: enable full-screen game mode\n");
|
printf("\t--enable-game-mode: enable full-screen game mode\n");
|
||||||
printf("\t--disable-splash-screen: disable splash screen\n");
|
printf("\t--disable-splash-screen: disable splash screen\n");
|
||||||
printf("\t--enable-splash-screen: enable splash screen\n");
|
printf("\t--enable-splash-screen: enable splash screen\n");
|
||||||
printf("\t--disable-intro-music: disable introduction music\n");
|
printf("\t--disable-intro-music: disable introduction music\n");
|
||||||
|
@ -579,6 +579,9 @@ fgOPTIONS::~fgOPTIONS( void ) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.24 1998/09/08 15:04:33 curt
|
||||||
|
// Optimizations by Norman Vine.
|
||||||
|
//
|
||||||
// Revision 1.23 1998/08/27 17:02:07 curt
|
// Revision 1.23 1998/08/27 17:02:07 curt
|
||||||
// Contributions from Bernie Bright <bbright@c031.aone.net.au>
|
// Contributions from Bernie Bright <bbright@c031.aone.net.au>
|
||||||
// - use strings for fg_root and airport_id and added methods to return
|
// - use strings for fg_root and airport_id and added methods to return
|
||||||
|
|
|
@ -59,7 +59,7 @@ void fgVIEW::Init( void ) {
|
||||||
winWidth = 640; // FG_DEFAULT_WIN_WIDTH
|
winWidth = 640; // FG_DEFAULT_WIN_WIDTH
|
||||||
winHeight = 480; // FG_DEFAULT_WIN_HEIGHT
|
winHeight = 480; // FG_DEFAULT_WIN_HEIGHT
|
||||||
win_ratio = (double) winWidth / (double) winHeight;
|
win_ratio = (double) winWidth / (double) winHeight;
|
||||||
update_fov = TRUE;
|
update_fov = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,18 +75,24 @@ void fgVIEW::UpdateFOV( fgOPTIONS *o ) {
|
||||||
// printf("theta_x = %.2f\n", theta_x);
|
// printf("theta_x = %.2f\n", theta_x);
|
||||||
sin_fov_x = sin(theta_x);
|
sin_fov_x = sin(theta_x);
|
||||||
cos_fov_x = cos(theta_x);
|
cos_fov_x = cos(theta_x);
|
||||||
slope_x = - cos_fov_x / sin_fov_x;
|
slope_x = -cos_fov_x / sin_fov_x;
|
||||||
// (HUH?) sin_fov_x /= slope_x;
|
|
||||||
// printf("slope_x = %.2f\n", slope_x);
|
// printf("slope_x = %.2f\n", slope_x);
|
||||||
|
|
||||||
|
#if defined( USE_FAST_FOV_CLIP )
|
||||||
|
fov_x_clip = slope_x*cos_fov_x - sin_fov_x;
|
||||||
|
#endif // defined( USE_FAST_FOV_CLIP )
|
||||||
|
|
||||||
// calculate sin() and cos() of fov / 2 in Y direction;
|
// calculate sin() and cos() of fov / 2 in Y direction;
|
||||||
theta_y = (fov * DEG_TO_RAD) / 2.0;
|
theta_y = (fov * DEG_TO_RAD) / 2.0;
|
||||||
// printf("theta_y = %.2f\n", theta_y);
|
// printf("theta_y = %.2f\n", theta_y);
|
||||||
sin_fov_y = sin(theta_y);
|
sin_fov_y = sin(theta_y);
|
||||||
cos_fov_y = cos(theta_y);
|
cos_fov_y = cos(theta_y);
|
||||||
slope_y = cos_fov_y / sin_fov_y;
|
slope_y = cos_fov_y / sin_fov_y;
|
||||||
// (HUH?) sin_fov_y /= slope_y;
|
|
||||||
// printf("slope_y = %.2f\n", slope_y);
|
// printf("slope_y = %.2f\n", slope_y);
|
||||||
|
|
||||||
|
#if defined( USE_FAST_FOV_CLIP )
|
||||||
|
fov_y_clip = -(slope_y*cos_fov_y + sin_fov_y);
|
||||||
|
#endif // defined( USE_FAST_FOV_CLIP )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -249,10 +255,10 @@ void fgVIEW::UpdateViewMath( fgFLIGHT *f ) {
|
||||||
MAT3mat R, TMP, UP, LOCAL, VIEW;
|
MAT3mat R, TMP, UP, LOCAL, VIEW;
|
||||||
double ntmp;
|
double ntmp;
|
||||||
|
|
||||||
if(update_fov == TRUE) {
|
if(update_fov == true) {
|
||||||
// printf("Updating fov\n");
|
// printf("Updating fov\n");
|
||||||
UpdateFOV(¤t_options);
|
UpdateFOV(¤t_options);
|
||||||
update_fov = FALSE;
|
update_fov = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
scenery.center.x = scenery.next_center.x;
|
scenery.center.x = scenery.next_center.x;
|
||||||
|
@ -538,6 +544,9 @@ fgVIEW::~fgVIEW( void ) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.20 1998/09/08 15:04:35 curt
|
||||||
|
// Optimizations by Norman Vine.
|
||||||
|
//
|
||||||
// Revision 1.19 1998/08/20 20:32:34 curt
|
// Revision 1.19 1998/08/20 20:32:34 curt
|
||||||
// Reshuffled some of the code in and around views.[ch]xx
|
// Reshuffled some of the code in and around views.[ch]xx
|
||||||
//
|
//
|
||||||
|
|
|
@ -40,14 +40,10 @@
|
||||||
|
|
||||||
#include "options.hxx"
|
#include "options.hxx"
|
||||||
|
|
||||||
#ifndef BOOL
|
|
||||||
#define BOOL int
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef TRUE
|
// used in views.cxx and tilemgr.cxx
|
||||||
#define FALSE 0
|
#define USE_FAST_FOV_CLIP
|
||||||
#define TRUE 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Define a structure containing view information
|
// Define a structure containing view information
|
||||||
class fgVIEW {
|
class fgVIEW {
|
||||||
|
@ -61,7 +57,7 @@ public:
|
||||||
double goal_view_offset;
|
double goal_view_offset;
|
||||||
|
|
||||||
// flag forcing update of fov related stuff
|
// flag forcing update of fov related stuff
|
||||||
BOOL update_fov;
|
bool update_fov;
|
||||||
|
|
||||||
// fov of view is specified in the y direction, win_ratio is used to
|
// fov of view is specified in the y direction, win_ratio is used to
|
||||||
// calculate the fov in the X direction = width/height
|
// calculate the fov in the X direction = width/height
|
||||||
|
@ -83,6 +79,10 @@ public:
|
||||||
// slope of view frustum edge in eye space X axis
|
// slope of view frustum edge in eye space X axis
|
||||||
double slope_x;
|
double slope_x;
|
||||||
|
|
||||||
|
#if defined( USE_FAST_FOV_CLIP )
|
||||||
|
double fov_x_clip, fov_y_clip;
|
||||||
|
#endif // USE_FAST_FOV_CLIP
|
||||||
|
|
||||||
// View frustum cull ratio (% of tiles culled ... used for
|
// View frustum cull ratio (% of tiles culled ... used for
|
||||||
// reporting purposes)
|
// reporting purposes)
|
||||||
double vfc_ratio;
|
double vfc_ratio;
|
||||||
|
@ -181,6 +181,9 @@ extern fgVIEW current_view;
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.13 1998/09/08 15:04:36 curt
|
||||||
|
// Optimizations by Norman Vine.
|
||||||
|
//
|
||||||
// Revision 1.12 1998/08/24 20:11:15 curt
|
// Revision 1.12 1998/08/24 20:11:15 curt
|
||||||
// Added i/I to toggle full vs. minimal HUD.
|
// Added i/I to toggle full vs. minimal HUD.
|
||||||
// Added a --hud-tris vs --hud-culled option.
|
// Added a --hud-tris vs --hud-culled option.
|
||||||
|
|
Loading…
Add table
Reference in a new issue