Commit efdb8a39 authored by nanahira's avatar nanahira

fix

parent 38f4f2f7
...@@ -1262,11 +1262,7 @@ void Game::DrawDeckBd() { ...@@ -1262,11 +1262,7 @@ void Game::DrawDeckBd() {
driver->draw2DRectangle(Resize(805, 160, 1020, 630), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000); driver->draw2DRectangle(Resize(805, 160, 1020, 630), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(804, 159, 1020, 630)); driver->draw2DRectangleOutline(Resize(804, 159, 1020, 630));
} }
<<<<<<< HEAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
=======
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD #ifdef YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>> 47859b49df470c09130a8ed4cb9922ab8036c538
constexpr int MAX_RESULT = 9; constexpr int MAX_RESULT = 9;
#else #else
constexpr int MAX_RESULT = 7; constexpr int MAX_RESULT = 7;
......
#include "image_manager.h" #include "image_manager.h"
#include "game.h" #include "game.h"
<<<<<<< HEAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
=======
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD #ifdef YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>> 47859b49df470c09130a8ed4cb9922ab8036c538
#include <thread> #include <thread>
#endif #endif
#ifdef _OPENMP #ifdef _OPENMP
...@@ -26,11 +22,7 @@ bool ImageManager::Initial() { ...@@ -26,11 +22,7 @@ bool ImageManager::Initial() {
tUnknownFit = nullptr; tUnknownFit = nullptr;
tUnknownThumb = nullptr; tUnknownThumb = nullptr;
tBigPicture = nullptr; tBigPicture = nullptr;
<<<<<<< HEAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
=======
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD #ifdef YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>> 47859b49df470c09130a8ed4cb9922ab8036c538
tLoading = nullptr; tLoading = nullptr;
tThumbLoadingThreadRunning = false; tThumbLoadingThreadRunning = false;
#endif #endif
...@@ -74,11 +66,7 @@ void ImageManager::ClearTexture() { ...@@ -74,11 +66,7 @@ void ImageManager::ClearTexture() {
driver->removeTexture(tit->second); driver->removeTexture(tit->second);
} }
for(auto tit = tThumb.begin(); tit != tThumb.end(); ++tit) { for(auto tit = tThumb.begin(); tit != tThumb.end(); ++tit) {
<<<<<<< HEAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
=======
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD #ifdef YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>> 47859b49df470c09130a8ed4cb9922ab8036c538
if(tit->second && tit->second != tLoading) if(tit->second && tit->second != tLoading)
#else #else
if(tit->second) if(tit->second)
...@@ -92,11 +80,7 @@ void ImageManager::ClearTexture() { ...@@ -92,11 +80,7 @@ void ImageManager::ClearTexture() {
tMap[0].clear(); tMap[0].clear();
tMap[1].clear(); tMap[1].clear();
tThumb.clear(); tThumb.clear();
<<<<<<< HEAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
=======
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD #ifdef YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>> 47859b49df470c09130a8ed4cb9922ab8036c538
tThumbLoadingMutex.lock(); tThumbLoadingMutex.lock();
tThumbLoading.clear(); tThumbLoading.clear();
while(!tThumbLoadingCodes.empty()) while(!tThumbLoadingCodes.empty())
...@@ -139,11 +123,7 @@ void ImageManager::ResizeTexture() { ...@@ -139,11 +123,7 @@ void ImageManager::ResizeTexture() {
driver->removeTexture(tUnknown); driver->removeTexture(tUnknown);
driver->removeTexture(tUnknownFit); driver->removeTexture(tUnknownFit);
driver->removeTexture(tUnknownThumb); driver->removeTexture(tUnknownThumb);
<<<<<<< HEAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
=======
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD #ifdef YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>> 47859b49df470c09130a8ed4cb9922ab8036c538
driver->removeTexture(tLoading); driver->removeTexture(tLoading);
tLoading = GetTextureFromFile("textures/cover.jpg", imgWidthThumb, imgHeightThumb); tLoading = GetTextureFromFile("textures/cover.jpg", imgWidthThumb, imgHeightThumb);
#endif #endif
...@@ -318,11 +298,7 @@ irr::video::ITexture* ImageManager::GetBigPicture(int code, float zoom) { ...@@ -318,11 +298,7 @@ irr::video::ITexture* ImageManager::GetBigPicture(int code, float zoom) {
tBigPicture = texture; tBigPicture = texture;
return texture; return texture;
} }
<<<<<<< HEAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
=======
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD #ifdef YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>> 47859b49df470c09130a8ed4cb9922ab8036c538
int ImageManager::LoadThumbThread() { int ImageManager::LoadThumbThread() {
while(true) { while(true) {
imageManager.tThumbLoadingMutex.lock(); imageManager.tThumbLoadingMutex.lock();
...@@ -378,19 +354,11 @@ int ImageManager::LoadThumbThread() { ...@@ -378,19 +354,11 @@ int ImageManager::LoadThumbThread() {
imageManager.tThumbLoadingMutex.unlock(); imageManager.tThumbLoadingMutex.unlock();
return 0; return 0;
} }
<<<<<<< HEAD
#endif // YGOPRO_USE_THUMB_LOAD_THERAD
irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
if(code == 0)
return tUnknownThumb;
#ifndef YGOPRO_USE_THUMB_LOAD_THERAD
=======
#endif // YGOPRO_USE_THUMB_LOAD_THREAD #endif // YGOPRO_USE_THUMB_LOAD_THREAD
irr::video::ITexture* ImageManager::GetTextureThumb(int code) { irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
if(code == 0) if(code == 0)
return tUnknownThumb; return tUnknownThumb;
#ifndef YGOPRO_USE_THUMB_LOAD_THREAD #ifndef YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>> 47859b49df470c09130a8ed4cb9922ab8036c538
auto tit = tThumb.find(code); auto tit = tThumb.find(code);
if(tit == tThumb.end()) { if(tit == tThumb.end()) {
char file[256]; char file[256];
...@@ -413,11 +381,7 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) { ...@@ -413,11 +381,7 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
tThumb[code] = img; tThumb[code] = img;
return (img == NULL) ? tUnknownThumb : img; return (img == NULL) ? tUnknownThumb : img;
} }
<<<<<<< HEAD
#else // YGOPRO_USE_THUMB_LOAD_THERAD
=======
#else // YGOPRO_USE_THUMB_LOAD_THREAD #else // YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>> 47859b49df470c09130a8ed4cb9922ab8036c538
imageManager.tThumbLoadingMutex.lock(); imageManager.tThumbLoadingMutex.lock();
auto lit = tThumbLoading.find(code); auto lit = tThumbLoading.find(code);
if(lit != tThumbLoading.end()) { if(lit != tThumbLoading.end()) {
...@@ -445,11 +409,7 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) { ...@@ -445,11 +409,7 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
imageManager.tThumbLoadingMutex.unlock(); imageManager.tThumbLoadingMutex.unlock();
return tLoading; return tLoading;
} }
<<<<<<< HEAD
#endif // YGOPRO_USE_THUMB_LOAD_THERAD
=======
#endif // YGOPRO_USE_THUMB_LOAD_THREAD #endif // YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>> 47859b49df470c09130a8ed4cb9922ab8036c538
if(tit->second) if(tit->second)
return tit->second; return tit->second;
else else
......
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