| 32 | |
| 33 | |
| 34 | void 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 | |
| 65 | void GFXCardProfiler::loadProfileScripts(const String& render, const String& vendor, const String& card, const String& version) |
| 66 | { |