@@ -91,6 +91,12 @@ HeightmapTexture::HeightmapTexture()
91
91
92
92
// ///////////////////////////////////////////////
93
93
Errors HeightmapTexture::Load (ElementPtr _sdf)
94
+ {
95
+ return this ->Load (_sdf, ParserConfig::GlobalConfig ());
96
+ }
97
+
98
+ // ///////////////////////////////////////////////
99
+ Errors HeightmapTexture::Load (ElementPtr _sdf, const ParserConfig &_config)
94
100
{
95
101
Errors errors;
96
102
@@ -126,8 +132,9 @@ Errors HeightmapTexture::Load(ElementPtr _sdf)
126
132
127
133
if (_sdf->HasElement (" diffuse" ))
128
134
{
129
- this ->dataPtr ->diffuse = _sdf->Get <std::string>(" diffuse" ,
130
- this ->dataPtr ->diffuse ).first ;
135
+ this ->dataPtr ->diffuse = resolveURI (
136
+ _sdf->Get <std::string>(" diffuse" , this ->dataPtr ->diffuse ).first ,
137
+ _config, errors);
131
138
}
132
139
else
133
140
{
@@ -137,8 +144,9 @@ Errors HeightmapTexture::Load(ElementPtr _sdf)
137
144
138
145
if (_sdf->HasElement (" normal" ))
139
146
{
140
- this ->dataPtr ->normal = _sdf->Get <std::string>(" normal" ,
141
- this ->dataPtr ->normal ).first ;
147
+ this ->dataPtr ->normal = resolveURI (
148
+ _sdf->Get <std::string>(" normal" , this ->dataPtr ->normal ).first ,
149
+ _config, errors);
142
150
}
143
151
else
144
152
{
@@ -285,6 +293,12 @@ Heightmap::Heightmap()
285
293
286
294
// ///////////////////////////////////////////////
287
295
Errors Heightmap::Load (ElementPtr _sdf)
296
+ {
297
+ return this ->Load (_sdf, ParserConfig::GlobalConfig ());
298
+ }
299
+
300
+ // ///////////////////////////////////////////////
301
+ Errors Heightmap::Load (ElementPtr _sdf, const ParserConfig &_config)
288
302
{
289
303
Errors errors;
290
304
@@ -311,7 +325,9 @@ Errors Heightmap::Load(ElementPtr _sdf)
311
325
312
326
if (_sdf->HasElement (" uri" ))
313
327
{
314
- this ->dataPtr ->uri = _sdf->Get <std::string>(" uri" , " " ).first ;
328
+ this ->dataPtr ->uri = resolveURI (
329
+ _sdf->Get <std::string>(" uri" , " " ).first ,
330
+ _config, errors);
315
331
}
316
332
else
317
333
{
@@ -332,7 +348,7 @@ Errors Heightmap::Load(ElementPtr _sdf)
332
348
this ->dataPtr ->sampling ).first ;
333
349
334
350
Errors textureLoadErrors = loadRepeated<HeightmapTexture>(_sdf,
335
- " texture" , this ->dataPtr ->textures );
351
+ " texture" , this ->dataPtr ->textures , _config );
336
352
errors.insert (errors.end (), textureLoadErrors.begin (),
337
353
textureLoadErrors.end ());
338
354
0 commit comments