| 1278 | } |
| 1279 | |
| 1280 | TextureGpu* loadGpuImage(const char* path) |
| 1281 | { |
| 1282 | std::map<std::string, TextureGpu*>::iterator iImage = s_gpuImages.find(path); |
| 1283 | if (iImage != s_gpuImages.end()) |
| 1284 | { |
| 1285 | return iImage->second; |
| 1286 | } |
| 1287 | |
| 1288 | char imagePath[TFE_MAX_PATH]; |
| 1289 | strcpy(imagePath, path); |
| 1290 | if (!TFE_Paths::mapSystemPath(imagePath)) |
| 1291 | { |
| 1292 | memset(imagePath, 0, TFE_MAX_PATH); |
| 1293 | TFE_Paths::appendPath(TFE_PathType::PATH_PROGRAM, path, imagePath, TFE_MAX_PATH); |
| 1294 | FileUtil::fixupPath(imagePath); |
| 1295 | } |
| 1296 | |
| 1297 | TextureGpu* gpuImage = nullptr; |
| 1298 | SDL_Surface* image = TFE_Image::get(imagePath); |
| 1299 | if (image) |
| 1300 | { |
| 1301 | gpuImage = TFE_RenderBackend::createTexture(image->w, image->h, (u32*)image->pixels, MAG_FILTER_LINEAR); |
| 1302 | if (gpuImage) |
| 1303 | { |
| 1304 | s_gpuImages[path] = gpuImage; |
| 1305 | } |
| 1306 | } |
| 1307 | return gpuImage; |
| 1308 | } |
| 1309 | |
| 1310 | void editor_clearUid() |
| 1311 | { |
no test coverage detected