MCPcopy Create free account
hub / github.com/CelestiaProject/Celestia / LoadVirtualTexture

Function LoadVirtualTexture

src/celengine/virtualtex.cpp:388–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386
387
388static VirtualTexture* LoadVirtualTexture(istream& in, const string& path)
389{
390 Tokenizer tokenizer(&in);
391 Parser parser(&tokenizer);
392
393 if (tokenizer.nextToken() != Tokenizer::TokenName)
394 return NULL;
395
396 string virtTexString = tokenizer.getNameValue();
397 if (virtTexString != "VirtualTexture")
398 return NULL;
399
400 Value* texParamsValue = parser.readValue();
401 if (texParamsValue == NULL || texParamsValue->getType() != Value::HashType)
402 {
403 DPRINTF(0, "Error parsing virtual texture\n");
404 delete texParamsValue;
405 return NULL;
406 }
407
408 Hash* texParams = texParamsValue->getHash();
409
410 VirtualTexture* virtualTex = CreateVirtualTexture(texParams, path);
411 delete texParamsValue;
412
413 return virtualTex;
414}
415
416
417VirtualTexture* LoadVirtualTexture(const string& filename)

Callers 1

LoadTextureFromFileFunction · 0.85

Calls 6

CreateVirtualTextureFunction · 0.85
nextTokenMethod · 0.80
getNameValueMethod · 0.80
readValueMethod · 0.80
getHashMethod · 0.80
getTypeMethod · 0.45

Tested by

no test coverage detected