- Perform the SGPath::validate() test for read access before returning a
path obtained with a non-null second argument ("aContext").
- If SGPath(aContext, aResource) is an absolute path for which read
access is authorized by SGPath::validate(), return it. This restores
the possibility of using the 'play-audio-sample' FGCommand with an
absolute, read-allowed path (was lost in FG commit 8853fded2953959).
- Because a fair number of the existing uses of
ResourceManager::findPath() are not quite correct IMO, we execute the
final part where all providers are tried in turn even if
SGPath(aContext, aResource) is an absolute path (otherwise, the sim
wouldn't start because it couldn't load materials.xml---see [1]).
- The SG_LOG call will spot a few errors in calling code/data, such as
access tried for
'/Aircraft/Generic/flightrecorder/generic-piston-propeller-4.xml' and
'/Textures/Sky/cl_cumulus2.png'; since the function does not return at
this point, these incorrect absolute paths which should be relative
will still be given a chance with the BasePathProvider that has its
base path set to $FG_ROOT; thus, they will be found as before this
commit despite the new "access refused" warning (but please fix
them!).
This commit requires FlightGear commit e7594f46876fc6b0b.
[1] https://sourceforge.net/p/flightgear/mailman/message/37697516/
This will allow us to perform access control validation in SimGear. The
current implementation of SGPath::validate() is 99% Rebecca Palmer's
work (see fgValidatePath() in FlightGear commit
6a30e7086ea2f1a060dd77dab6e7e8a15b43e82d); only the coding style has
been slightly modernized here since we can now use, for instance,
C++11's range-based for loop.
This is to avoid confusion because the following commit will make
SGPath::validate(bool) replace the fgValidatePath() function from the
FlightGear repository.
- Add an explicit constructor SGSoundSample(const SGPath& file) that
directly uses the specified path instead of going through
ResourceManager::findPath().
- Reimplement the existing constructor as
SGSoundSample(const std::string& file, const SGPath& dir),
delegating to the new one.
- The first argument of the delegating constructor is now a
const std::string& instead of a const char*.
Among others, this will allow a better implementation of
FGSoundManager::playAudioSampleCommand(). More explanations can be found
here:
https://sourceforge.net/p/flightgear/mailman/message/37695786/
Previously 3D cloud re-position code did not re-orientate
the sprites, leading to the sprites being at an angle for
long flights.
Fix from Michael DANILOV to address this.
The assumption is that all images coming from Canvas should be excluded from inclusion into the DDS texture cache.
Previously there was special logic that only excluded transparent images of Canvas origin but this was probably wrong.
This gives knowledge of how to resolve relative paths, to makeEffects
invocation of findDataFile, and hence gives a more familiar lookup
ordering, for Aircraft-supplied effects.
SF-ID: https://sourceforge.net/p/flightgear/codetickets/2678/
The random lights placement algorithm was using the incorrect channel
from the object mask image, (red instead of blue as mentioned in
Docs/README.materials). This commit rectifies the mismatch.
The Canvas camera and texture get recreated in several circumstances.
Calling .release() on a ref_ptr will just return the raw pointer and
'delete' won't be called. The proper way to explicitly delete an object
managed by a ref_ptr is to set the ref_ptr to NULL. This will delete it
as long as it's not referenced by any other ref_ptr.
Attempt to narrow down the source of some fatal exceptions we see
on Senty, which occur during init/startup. All these blocks re-throw
so user behaviour is unchanged, but we’ll log the name of the subsytem.
When an effect defines no shader sources, special case this error to
avoid confusing result from SGProgram.
Add error-context for readNode STG loading, so failures inside an
STG can be attributed
Report errors from readWAV, and improve attribution for the
format error (include the file path). As a result, mark the individual
exceptions as dont-report, since we will report higher up.