MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / loadProfileScript

Method loadProfileScript

Engine/source/gfx/gfxCardProfile.cpp:34–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32
33
34void GFXCardProfiler::loadProfileScript(const char* aScriptName)
35{
36 const String profilePath = Con::getVariable( "$pref::Video::profilePath" );
37 String scriptName = !profilePath.isEmpty() ? profilePath.c_str() : "profile";
38 scriptName += "/";
39 scriptName += aScriptName;
40
41 void *data = NULL;
42 U32 dataSize = 0;
43
44
45 Torque::FS::ReadFile( scriptName.c_str(), data, dataSize, true );
46
47 if(data == NULL)
48 {
49#ifdef TORQUE_DEBUG
50 Con::warnf(" - No card profile %s exists", scriptName.c_str());
51#endif
52 return;
53 }
54
55 const char *script = static_cast<const char *>(data);
56
57#ifdef TORQUE_DEBUG
58 Con::printf(" - Loaded card profile %s", scriptName.c_str());
59#endif
60
61 Con::evaluate(script, false, NULL);
62 delete[] script;
63}
64
65void GFXCardProfiler::loadProfileScripts(const String& render, const String& vendor, const String& card, const String& version)
66{

Callers

nothing calls this directly

Calls 7

getVariableFunction · 0.85
printfFunction · 0.85
evaluateFunction · 0.85
ReadFileFunction · 0.50
warnfFunction · 0.50
isEmptyMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected