Commit 559895a9 authored by wind2009's avatar wind2009

Merge remote-tracking branch 'upstream/master' into develop

parents 6089920a 1d59451c
......@@ -276,10 +276,10 @@ int ImageManager::LoadThumbThread() {
imageManager.tThumbLoadingCodes.pop();
imageManager.tThumbLoadingMutex.unlock();
char file[256];
std::snprintf(file, sizeof file, "expansions/pics/%d.jpg", code);
mysnprintf(file, "expansions/pics/%d.jpg", code);
irr::video::IImage* img = imageManager.driver->createImageFromFile(file);
if(img == nullptr) {
std::snprintf(file, sizeof file, "pics/%d.jpg", code);
mysnprintf(file, "pics/%d.jpg", code);
img = imageManager.driver->createImageFromFile(file);
}
if(img != nullptr) {
......@@ -318,12 +318,12 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
auto tit = tThumb.find(code);
if(tit == tThumb.end() && !mainGame->gameConf.use_image_load_background_thread) {
char file[256];
std::snprintf(file, sizeof file, "expansions/pics/%d.jpg", code);
mysnprintf(file, "expansions/pics/%d.jpg", code);
int width = CARD_THUMB_WIDTH * mainGame->xScale;
int height = CARD_THUMB_HEIGHT * mainGame->yScale;
irr::video::ITexture* img = GetTextureFromFile(file, width, height);
if(img == NULL) {
std::snprintf(file, sizeof file, "pics/%d.jpg", code);
mysnprintf(file, "pics/%d.jpg", code);
img = GetTextureFromFile(file, width, height);
}
tThumb[code] = img;
......@@ -335,7 +335,7 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
if(lit != tThumbLoading.end()) {
if(lit->second != nullptr) {
char file[256];
std::snprintf(file, sizeof file, "pics/%d.jpg", code);
mysnprintf(file, "pics/%d.jpg", code);
irr::video::ITexture* texture = driver->addTexture(file, lit->second); // textures must be added in the main thread due to OpenGL
lit->second->drop();
tThumb[code] = texture;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment