static double julian_date = 0;
static const double MJD0 = 2415020.0;
if ( first_time ) {
- julian_date = sgTimeCurrentMJD() + MJD0;
+ julian_date = sgTimeCurrentMJD(0, 0) + MJD0;
first_time = false;
}
= fgGetNode("/position/longitude-deg");
static const SGPropertyNode *latitude
= fgGetNode("/position/latitude-deg");
-
+ static const SGPropertyNode *cur_time_override
+ = fgGetNode("/sim/time/cur-time-override", true);
+
SGPath zone( globals->get_fg_root() );
zone.append( "Timezone" );
SGTime *t = new SGTime( longitude->getDoubleValue()
* SGD_DEGREES_TO_RADIANS,
latitude->getDoubleValue()
* SGD_DEGREES_TO_RADIANS,
- zone.str() );
+ zone.str(),
+ cur_time_override->getLongValue() );
// Handle potential user specified time offsets
time_t cur_time = t->get_cur_time();
globals->set_warp_delta( 0 );
- t->update( 0.0, 0.0, globals->get_warp() );
+ t->update( 0.0, 0.0,
+ cur_time_override->getLongValue(),
+ globals->get_warp() );
return t;
}
static void
setDateString (string date_string)
{
+ static const SGPropertyNode *cur_time_override
+ = fgGetNode("/sim/time/cur-time-override", true);
+
SGTime * st = globals->get_time_params();
struct tm * current_time = st->getGmt();
struct tm new_time;
double lon = current_aircraft.fdm_state->get_Longitude();
double lat = current_aircraft.fdm_state->get_Latitude();
globals->set_warp(warp);
- st->update(lon, lat, warp);
+ st->update(lon, lat, cur_time_override->getLongValue(), warp);
fgUpdateSkyAndLightingParams();
}
{
string out;
char buf[16];
- struct tm * t = globals->get_time_params()->getGmt();
+ struct tm *t = globals->get_time_params()->getGmt();
sprintf(buf, " %.2d:%.2d:%.2d",
t->tm_hour, t->tm_min, t->tm_sec);
+ // cout << t << " " << buf << endl;
out = buf;
return out;
}
static double julian_date = 0;
static const double MJD0 = 2415020.0;
if ( first_time ) {
- julian_date = sgTimeCurrentMJD() + MJD0;
+ julian_date = sgTimeCurrentMJD(0,0) + MJD0;
first_time = false;
}
void
FGTileLoader::update()
{
+
#ifdef ENABLE_THREADS
// send a signal to the pager thread that it is allowed to load
// another tile
// load the next tile in the queue
FGTileEntry* tile = tile_load_queue.front();
tile_load_queue.pop();
+
tile->load( tile_path, true );
+
FGTileMgr::ready_to_attach( tile );
}
#endif
#endif // ENABLE_THREADS
+
}
SGPath custom_path = tile_path;
custom_path.append( name );
+
ssgBranch *custom_obj
= obj_load( custom_path.str(), NULL, false );
if ( custom_obj != NULL ) {
// activate loader thread one out of every 5 frames
if ( counter_hack == 0 ) {
// Notify the tile loader that it can load another tile
+
loader.update();
}