Merge branch 'next' of git://gitorious.org/fg/flightgear into next
This commit is contained in:
commit
c676ffaf53
8 changed files with 20 additions and 12 deletions
|
@ -771,7 +771,7 @@ CameraInfo* CameraGroup::buildCamera(SGPropertyNode* cameraNode)
|
||||||
parentCameraIndex = i;
|
parentCameraIndex = i;
|
||||||
}
|
}
|
||||||
if (_cameras.size() <= parentCameraIndex) {
|
if (_cameras.size() <= parentCameraIndex) {
|
||||||
SG_LOG(SG_GENERAL, SG_ALERT, "CameraGroup::buildCamera: "
|
SG_LOG(SG_VIEW, SG_ALERT, "CameraGroup::buildCamera: "
|
||||||
"failed to find parent camera for relative camera!");
|
"failed to find parent camera for relative camera!");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -896,7 +896,7 @@ CameraInfo* CameraGroup::buildGUICamera(SGPropertyNode* cameraNode,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!window) { // buildWindow can fail
|
if (!window) { // buildWindow can fail
|
||||||
SG_LOG(SG_GENERAL, SG_WARN, "CameraGroup::buildGUICamera: failed to build a window");
|
SG_LOG(SG_VIEW, SG_WARN, "CameraGroup::buildGUICamera: failed to build a window");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -239,6 +239,7 @@ bool FGEventHandler::handle(const osgGA::GUIEventAdapter& ea,
|
||||||
(*mouseMotionHandler)(x, y);
|
(*mouseMotionHandler)(x, y);
|
||||||
return true;
|
return true;
|
||||||
case osgGA::GUIEventAdapter::RESIZE:
|
case osgGA::GUIEventAdapter::RESIZE:
|
||||||
|
SG_LOG(SG_VIEW, SG_DEBUG, "FGEventHandler::handle: RESIZE event " << ea.getWindowHeight() << " x " << ea.getWindowWidth() << ", resizable: " << resizable);
|
||||||
CameraGroup::getDefault()->resized();
|
CameraGroup::getDefault()->resized();
|
||||||
if (resizable)
|
if (resizable)
|
||||||
globals->get_renderer()->resize(ea.getWindowWidth(), ea.getWindowHeight());
|
globals->get_renderer()->resize(ea.getWindowWidth(), ea.getWindowHeight());
|
||||||
|
|
|
@ -90,6 +90,7 @@ WindowBuilder::makeDefaultTraits(bool stencil)
|
||||||
traits->supportsResize = false;
|
traits->supportsResize = false;
|
||||||
traits->width = screenwidth;
|
traits->width = screenwidth;
|
||||||
traits->height = screenheight;
|
traits->height = screenheight;
|
||||||
|
SG_LOG(SG_VIEW,SG_DEBUG,"Using full screen size for window: " << screenwidth << " x " << screenheight);
|
||||||
} else {
|
} else {
|
||||||
// window
|
// window
|
||||||
int w = fgGetInt("/sim/startup/xsize");
|
int w = fgGetInt("/sim/startup/xsize");
|
||||||
|
@ -102,6 +103,7 @@ WindowBuilder::makeDefaultTraits(bool stencil)
|
||||||
traits->x = ((unsigned)w>screenwidth) ? 0 : (screenwidth-w)/3;
|
traits->x = ((unsigned)w>screenwidth) ? 0 : (screenwidth-w)/3;
|
||||||
traits->y = ((unsigned)h>screenheight) ? 0 : (screenheight-h)/3;
|
traits->y = ((unsigned)h>screenheight) ? 0 : (screenheight-h)/3;
|
||||||
}
|
}
|
||||||
|
SG_LOG(SG_VIEW,SG_DEBUG,"Using initial window size: " << w << " x " << h);
|
||||||
}
|
}
|
||||||
return traits;
|
return traits;
|
||||||
}
|
}
|
||||||
|
@ -245,7 +247,7 @@ GraphicsWindow* WindowBuilder::getDefaultWindow()
|
||||||
->registerWindow(gc, defaultWindowName);
|
->registerWindow(gc, defaultWindowName);
|
||||||
return defaultWindow;
|
return defaultWindow;
|
||||||
} else {
|
} else {
|
||||||
SG_LOG(SG_GENERAL, SG_ALERT, "getDefaultWindow: failed to create GraphicsContext");
|
SG_LOG(SG_VIEW, SG_ALERT, "getDefaultWindow: failed to create GraphicsContext");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -805,6 +805,7 @@ FGRenderer::resize( int width, int height )
|
||||||
{
|
{
|
||||||
int curWidth = _xsize->getIntValue(),
|
int curWidth = _xsize->getIntValue(),
|
||||||
curHeight = _ysize->getIntValue();
|
curHeight = _ysize->getIntValue();
|
||||||
|
SG_LOG(SG_VIEW, SG_DEBUG, "FGRenderer::resize: new size " << width << " x " << height);
|
||||||
if ((curHeight != height) || (curWidth != width)) {
|
if ((curHeight != height) || (curWidth != width)) {
|
||||||
// must guard setting these, or PLIB-PUI fails with too many live interfaces
|
// must guard setting these, or PLIB-PUI fails with too many live interfaces
|
||||||
_xsize->setIntValue(width);
|
_xsize->setIntValue(width);
|
||||||
|
|
|
@ -195,7 +195,7 @@ static osg::Node* fgCreateSplashCamera()
|
||||||
tpath = globals->resolve_maybe_aircraft_path(splash_texture);
|
tpath = globals->resolve_maybe_aircraft_path(splash_texture);
|
||||||
if (tpath.isNull())
|
if (tpath.isNull())
|
||||||
{
|
{
|
||||||
SG_LOG( SG_GENERAL, SG_ALERT, "Cannot find splash screen file '" << splash_texture
|
SG_LOG( SG_VIEW, SG_ALERT, "Cannot find splash screen file '" << splash_texture
|
||||||
<< "'. Using default." );
|
<< "'. Using default." );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -366,11 +366,11 @@ osg::Node* fgCreateSplashNode() {
|
||||||
|
|
||||||
// Initialize the splash screen
|
// Initialize the splash screen
|
||||||
void fgSplashInit () {
|
void fgSplashInit () {
|
||||||
SG_LOG( SG_GENERAL, SG_INFO, "Initializing splash screen" );
|
SG_LOG( SG_VIEW, SG_INFO, "Initializing splash screen" );
|
||||||
globals->get_renderer()->splashinit();
|
globals->get_renderer()->splashinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void fgSplashProgress ( const char *text ) {
|
void fgSplashProgress ( const char *text ) {
|
||||||
SG_LOG( SG_GENERAL, SG_INFO, "Splash screen progress " << text );
|
SG_LOG( SG_VIEW, SG_INFO, "Splash screen progress " << text );
|
||||||
fgSetString("/sim/startup/splash-progress-text", text);
|
fgSetString("/sim/startup/splash-progress-text", text);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ void
|
||||||
FGViewMgr::init ()
|
FGViewMgr::init ()
|
||||||
{
|
{
|
||||||
if (inited) {
|
if (inited) {
|
||||||
SG_LOG(SG_GENERAL, SG_WARN, "duplicate init of view manager");
|
SG_LOG(SG_VIEW, SG_WARN, "duplicate init of view manager");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ using simgear::TileCache;
|
||||||
|
|
||||||
FGTileMgr::FGTileMgr():
|
FGTileMgr::FGTileMgr():
|
||||||
state( Start ),
|
state( Start ),
|
||||||
|
last_state( Running ),
|
||||||
vis( 16000 ),
|
vis( 16000 ),
|
||||||
_terra_sync(NULL)
|
_terra_sync(NULL)
|
||||||
{
|
{
|
||||||
|
@ -341,7 +342,6 @@ void FGTileMgr::update_queues()
|
||||||
// disk.
|
// disk.
|
||||||
void FGTileMgr::update(double)
|
void FGTileMgr::update(double)
|
||||||
{
|
{
|
||||||
SG_LOG( SG_TERRAIN, SG_DEBUG, "FGTileMgr::update()" );
|
|
||||||
SGVec3d viewPos = globals->get_current_view()->get_view_pos();
|
SGVec3d viewPos = globals->get_current_view()->get_view_pos();
|
||||||
double vis = _visibilityMeters->getDoubleValue();
|
double vis = _visibilityMeters->getDoubleValue();
|
||||||
schedule_tiles_at(SGGeod::fromCart(viewPos), vis);
|
schedule_tiles_at(SGGeod::fromCart(viewPos), vis);
|
||||||
|
@ -373,7 +373,10 @@ int FGTileMgr::schedule_tiles_at(const SGGeod& location, double range_m)
|
||||||
// do tile load scheduling.
|
// do tile load scheduling.
|
||||||
// Note that we need keep track of both viewer buckets and fdm buckets.
|
// Note that we need keep track of both viewer buckets and fdm buckets.
|
||||||
if ( state == Running ) {
|
if ( state == Running ) {
|
||||||
SG_LOG( SG_TERRAIN, SG_DEBUG, "State == Running" );
|
if (last_state != state)
|
||||||
|
{
|
||||||
|
SG_LOG( SG_TERRAIN, SG_DEBUG, "State == Running" );
|
||||||
|
}
|
||||||
if (current_bucket != previous_bucket) {
|
if (current_bucket != previous_bucket) {
|
||||||
// We've moved to a new bucket, we need to schedule any
|
// We've moved to a new bucket, we need to schedule any
|
||||||
// needed tiles for loading.
|
// needed tiles for loading.
|
||||||
|
@ -386,11 +389,12 @@ int FGTileMgr::schedule_tiles_at(const SGGeod& location, double range_m)
|
||||||
// save bucket
|
// save bucket
|
||||||
previous_bucket = current_bucket;
|
previous_bucket = current_bucket;
|
||||||
} else if ( state == Start || state == Inited ) {
|
} else if ( state == Start || state == Inited ) {
|
||||||
SG_LOG( SG_TERRAIN, SG_INFO, "State == Start || Inited" );
|
SG_LOG( SG_TERRAIN, SG_DEBUG, "State == Start || Inited" );
|
||||||
// do not update bucket yet (position not valid in initial loop)
|
// do not update bucket yet (position not valid in initial loop)
|
||||||
state = Running;
|
state = Running;
|
||||||
previous_bucket.make_bad();
|
previous_bucket.make_bad();
|
||||||
}
|
}
|
||||||
|
last_state = state;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ private:
|
||||||
Running = 2
|
Running = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
load_state state;
|
load_state state, last_state;
|
||||||
|
|
||||||
// schedule a tile for loading, returns true when tile is already loaded
|
// schedule a tile for loading, returns true when tile is already loaded
|
||||||
bool sched_tile( const SGBucket& b, double priority,bool current_view, double request_time);
|
bool sched_tile( const SGBucket& b, double priority,bool current_view, double request_time);
|
||||||
|
|
Loading…
Reference in a new issue