fix #142: initial window position
Be (at least a bit) smarter with initial x/y position Also some minor type/comment issues.
This commit is contained in:
parent
3c8a80d968
commit
863551a932
6 changed files with 15 additions and 14 deletions
|
@ -69,9 +69,9 @@ WindowBuilder::makeDefaultTraits(bool stencil)
|
|||
traits->red = traits->green = traits->blue = cbits;
|
||||
traits->depth = zbits;
|
||||
if (alpha)
|
||||
traits->alpha = 8;
|
||||
traits->alpha = 8;
|
||||
if (stencil)
|
||||
traits->stencil = 8;
|
||||
traits->stencil = 8;
|
||||
traits->doubleBuffer = true;
|
||||
traits->mipMapGeneration = true;
|
||||
traits->windowName = "FlightGear";
|
||||
|
@ -83,20 +83,21 @@ WindowBuilder::makeDefaultTraits(bool stencil)
|
|||
unsigned width = 0;
|
||||
unsigned height = 0;
|
||||
wsi->getScreenResolution(*traits, width, height);
|
||||
traits->windowDecoration = false;
|
||||
traits->windowDecoration = false;
|
||||
traits->width = width;
|
||||
traits->height = height;
|
||||
traits->supportsResize = false;
|
||||
} else {
|
||||
traits->windowDecoration = true;
|
||||
traits->windowDecoration = true;
|
||||
traits->width = w;
|
||||
traits->height = h;
|
||||
#if defined(WIN32) || defined(__APPLE__)
|
||||
unsigned screenwidth = 0;
|
||||
unsigned screenheight = 0;
|
||||
wsi->getScreenResolution(*traits, screenwidth, screenheight);
|
||||
// Ugly Hack, why does CW_USEDEFAULT works like phase of the moon?
|
||||
// Mac also needs this to show window frame, menubar and Docks
|
||||
traits->x = 100;
|
||||
traits->y = 100;
|
||||
#endif
|
||||
traits->x = (w>screenwidth) ? 0 : (screenwidth-w)/3;
|
||||
traits->y = (h>screenheight) ? 0 : (screenheight-h)/3;
|
||||
traits->supportsResize = true;
|
||||
}
|
||||
return traits;
|
||||
|
|
|
@ -1838,7 +1838,7 @@ fgUsage (bool verbose)
|
|||
|
||||
while ( t_str.size() > 47 ) {
|
||||
|
||||
unsigned int m = t_str.rfind(' ', 47);
|
||||
string::size_type m = t_str.rfind(' ', 47);
|
||||
msg += t_str.substr(0, m) + '\n';
|
||||
msg.append( 32, ' ');
|
||||
|
||||
|
|
|
@ -356,7 +356,7 @@ FGViewMgr::update (double dt)
|
|||
abs_viewer_position = loop_view->getViewPosition();
|
||||
|
||||
// update audio listener values
|
||||
// set the viewer posotion in Cartesian coordinates in meters
|
||||
// set the viewer position in Cartesian coordinates in meters
|
||||
smgr->set_position( abs_viewer_position, loop_view->getPosition() );
|
||||
smgr->set_orientation( current_view_orientation );
|
||||
|
||||
|
|
|
@ -164,7 +164,7 @@ struct FGExternalMotionData {
|
|||
// the earth centered frame
|
||||
SGVec3f angularAccel;
|
||||
|
||||
// The set of properties recieved for this timeslot
|
||||
// The set of properties received for this timeslot
|
||||
std::vector<FGPropertyData*> properties;
|
||||
|
||||
~FGExternalMotionData()
|
||||
|
|
|
@ -80,7 +80,7 @@ FGSampleQueue::update (double dt)
|
|||
last_volume = volume;
|
||||
}
|
||||
|
||||
// process mesage queue
|
||||
// process message queue
|
||||
const string msgid = "Sequential Audio Message";
|
||||
bool now_playing = false;
|
||||
if ( exists( msgid ) ) {
|
||||
|
|
|
@ -345,7 +345,7 @@ void FGLight::update_adj_fog_color () {
|
|||
else
|
||||
hor_rotation = fmod(hor_rotation, SGD_2PI);
|
||||
|
||||
// revert to unmodified values before usign them.
|
||||
// revert to unmodified values before using them.
|
||||
//
|
||||
SGVec4f color = thesky->get_scene_color();
|
||||
|
||||
|
@ -359,7 +359,7 @@ void FGLight::update_adj_fog_color () {
|
|||
float s_green = color[1]*color[1]*color[1];
|
||||
float s_blue = color[2]*color[2];
|
||||
|
||||
// interpolate beween the sunrise/sunset color and the color
|
||||
// interpolate between the sunrise/sunset color and the color
|
||||
// at the opposite direction of this effect. Take in account
|
||||
// the current visibility.
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue