1
0
Fork 0

Event more local8Bit -> UTF8 fixes

This commit is contained in:
James Turner 2020-03-13 09:53:49 +00:00
parent 19eaaf04ee
commit e492ddd5a0
10 changed files with 14 additions and 15 deletions

View file

@ -247,8 +247,8 @@ do_materials_reload (const SGPropertyNode * arg, SGPropertyNode * root)
SGMaterialLib* new_matlib = new SGMaterialLib; SGMaterialLib* new_matlib = new SGMaterialLib;
SGPath mpath( globals->get_fg_root() ); SGPath mpath( globals->get_fg_root() );
mpath.append( fgGetString("/sim/rendering/materials-file") ); mpath.append( fgGetString("/sim/rendering/materials-file") );
bool loaded = new_matlib->load(globals->get_fg_root().local8BitStr(), bool loaded = new_matlib->load(globals->get_fg_root(),
mpath.local8BitStr(), mpath,
globals->get_props()); globals->get_props());
if ( ! loaded ) { if ( ! loaded ) {

View file

@ -359,7 +359,7 @@ static void fgIdleFunction ( void ) {
flightgear::initPosition(); flightgear::initPosition();
flightgear::initTowerLocationListener(); flightgear::initTowerLocationListener();
simgear::SGModelLib::init(globals->get_fg_root().local8BitStr(), globals->get_props()); simgear::SGModelLib::init(globals->get_fg_root().utf8Str(), globals->get_props());
auto timeManager = globals->get_subsystem<TimeManager>(); auto timeManager = globals->get_subsystem<TimeManager>();
timeManager->init(); timeManager->init();

View file

@ -33,7 +33,7 @@ static osg::Node *
fgLoad3DModelPanel(const SGPath &path, SGPropertyNode *prop_root) fgLoad3DModelPanel(const SGPath &path, SGPropertyNode *prop_root)
{ {
bool loadPanels = true; bool loadPanels = true;
osg::Node* node = simgear::SGModelLib::loadModel(path.local8BitStr(), prop_root, NULL, loadPanels); osg::Node* node = simgear::SGModelLib::loadModel(path.utf8Str(), prop_root, NULL, loadPanels);
if (node) if (node)
node->setNodeMask(~SG_NODEMASK_TERRAIN_BIT); node->setNodeMask(~SG_NODEMASK_TERRAIN_BIT);
return node; return node;

View file

@ -168,9 +168,8 @@ void FGTileMgr::reinit()
osgDB::FilePathList &fp = _options->getDatabasePathList(); osgDB::FilePathList &fp = _options->getDatabasePathList();
const PathList &sc = globals->get_fg_scenery(); const PathList &sc = globals->get_fg_scenery();
fp.clear(); fp.clear();
PathList::const_iterator it; for (auto it = sc.begin(); it != sc.end(); ++it) {
for (it = sc.begin(); it != sc.end(); ++it) { fp.push_back(it->utf8Str());
fp.push_back(it->local8BitStr());
} }
_options->setPluginStringData("SimGear::FG_ROOT", globals->get_fg_root().utf8Str()); _options->setPluginStringData("SimGear::FG_ROOT", globals->get_fg_root().utf8Str());

View file

@ -774,7 +774,7 @@ static naRef f_open(naContext c, naRef me, int argc, naRef* args)
std::wstring wmodestr = simgear::strutils::convertUtf8ToWString(modestr); std::wstring wmodestr = simgear::strutils::convertUtf8ToWString(modestr);
f = _wfopen(fp.c_str(), wmodestr.c_str()); f = _wfopen(fp.c_str(), wmodestr.c_str());
#else #else
std::string fp = filename.local8BitStr(); std::string fp = filename.utf8Str();
f = fopen(fp.c_str(), modestr); f = fopen(fp.c_str(), modestr);
#endif #endif
if(!f) naRuntimeError(c, strerror(errno)); if(!f) naRuntimeError(c, strerror(errno));

View file

@ -76,7 +76,7 @@ string FLITEVoiceSynthesizer::getVoicePath( voice_t voice )
{ {
if( voice < 0 || voice >= VOICE_UNKNOWN ) return string(""); if( voice < 0 || voice >= VOICE_UNKNOWN ) return string("");
SGPath voicePath = globals->get_fg_root() / "ATC" / VOICE_FILES[voice]; SGPath voicePath = globals->get_fg_root() / "ATC" / VOICE_FILES[voice];
return voicePath.local8BitStr(); return voicePath.utf8Str();
} }
string FLITEVoiceSynthesizer::getVoicePath( const string & voice ) string FLITEVoiceSynthesizer::getVoicePath( const string & voice )

View file

@ -41,7 +41,7 @@ FGFLITEVoice::FGFLITEVoice(FGVoiceMgr * mgr, const SGPropertyNode_ptr node, cons
SGPath voice = globals->get_fg_root() / "ATC" / SGPath voice = globals->get_fg_root() / "ATC" /
node->getStringValue("htsvoice", "cmu_us_arctic_slt.htsvoice"); node->getStringValue("htsvoice", "cmu_us_arctic_slt.htsvoice");
_synthesizer = new FLITEVoiceSynthesizer(voice.local8BitStr()); _synthesizer = new FLITEVoiceSynthesizer(voice.utf8Str());
SGSoundMgr *smgr = globals->get_subsystem<SGSoundMgr>(); SGSoundMgr *smgr = globals->get_subsystem<SGSoundMgr>();
_sgr = smgr->find(sampleGroupRefName, true); _sgr = smgr->find(sampleGroupRefName, true);

View file

@ -690,7 +690,7 @@ void CameraGroup::buildCamera(SGPropertyNode* cameraNode)
std::string compositor_path = std::string compositor_path =
cameraNode->getStringValue("compositor", default_compositor.c_str()); cameraNode->getStringValue("compositor", default_compositor.c_str());
osg::ref_ptr<SGReaderWriterOptions> options = osg::ref_ptr<SGReaderWriterOptions> options =
SGReaderWriterOptions::fromPath(globals->get_fg_root().local8BitStr()); SGReaderWriterOptions::fromPath(globals->get_fg_root());
options->setPropertyNode(globals->get_props()); options->setPropertyNode(globals->get_props());
Compositor *compositor = Compositor::create(_viewer, Compositor *compositor = Compositor::create(_viewer,
window->gc, window->gc,

View file

@ -529,7 +529,7 @@ FGRenderer::setupView( void )
// Moon diameter: 3,476 kilometers // Moon diameter: 3,476 kilometers
// Sun diameter: 1,390,000 kilometers // Sun diameter: 1,390,000 kilometers
osg::ref_ptr<simgear::SGReaderWriterOptions> opt; osg::ref_ptr<simgear::SGReaderWriterOptions> opt;
opt = simgear::SGReaderWriterOptions::fromPath(globals->get_fg_root().local8BitStr()); opt = simgear::SGReaderWriterOptions::fromPath(globals->get_fg_root());
opt->setPropertyNode(globals->get_props()); opt->setPropertyNode(globals->get_props());
_sky->build( 80000.0, 80000.0, _sky->build( 80000.0, 80000.0,
463.3, 361.8, 463.3, 361.8,

View file

@ -1136,7 +1136,7 @@ FGRenderer::buildDeferredFullscreenCamera( flightgear::CameraInfo* info, const F
g->setUseDisplayList(false); g->setUseDisplayList(false);
simgear::EffectGeode* eg = new simgear::EffectGeode; simgear::EffectGeode* eg = new simgear::EffectGeode;
osg::ref_ptr<SGReaderWriterOptions> opt; osg::ref_ptr<SGReaderWriterOptions> opt;
opt = SGReaderWriterOptions::fromPath(globals->get_fg_root().local8BitStr()); opt = SGReaderWriterOptions::fromPath(globals->get_fg_root());
opt->setPropertyNode(globals->get_props()); opt->setPropertyNode(globals->get_props());
simgear::Effect* effect = simgear::makeEffect(pass->effect, true, opt.get()); simgear::Effect* effect = simgear::makeEffect(pass->effect, true, opt.get());
if (effect) { if (effect) {
@ -1189,7 +1189,7 @@ FGRenderer::buildDeferredDisplayCamera( osg::Camera* camera, flightgear::CameraI
g->setUseDisplayList(false); //DEBUG g->setUseDisplayList(false); //DEBUG
simgear::EffectGeode* eg = new simgear::EffectGeode; simgear::EffectGeode* eg = new simgear::EffectGeode;
osg::ref_ptr<SGReaderWriterOptions> opt; osg::ref_ptr<SGReaderWriterOptions> opt;
opt = SGReaderWriterOptions::fromPath(globals->get_fg_root().local8BitStr()); opt = SGReaderWriterOptions::fromPath(globals->get_fg_root());
opt->setPropertyNode(globals->get_props()); opt->setPropertyNode(globals->get_props());
simgear::Effect* effect = simgear::makeEffect(stage->effect, true, opt.get()); simgear::Effect* effect = simgear::makeEffect(stage->effect, true, opt.get());
if (!effect) { if (!effect) {
@ -1422,7 +1422,7 @@ FGRenderer::setupView( void )
// Moon diameter: 3,476 kilometers // Moon diameter: 3,476 kilometers
// Sun diameter: 1,390,000 kilometers // Sun diameter: 1,390,000 kilometers
osg::ref_ptr<SGReaderWriterOptions> opt; osg::ref_ptr<SGReaderWriterOptions> opt;
opt = SGReaderWriterOptions::fromPath(globals->get_fg_root().local8BitStr()); opt = SGReaderWriterOptions::fromPath(globals->get_fg_root());
opt->setPropertyNode(globals->get_props()); opt->setPropertyNode(globals->get_props());
_sky->build( 80000.0, 80000.0, _sky->build( 80000.0, 80000.0,
463.3, 361.8, 463.3, 361.8,