Commit 005ab23b authored by mercury233's avatar mercury233

typo

parent 9f9ca37b
......@@ -1262,7 +1262,7 @@ void Game::DrawDeckBd() {
driver->draw2DRectangle(Resize(805, 160, 1020, 630), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(804, 159, 1020, 630));
}
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD
constexpr int MAX_RESULT = 9;
#else
constexpr int MAX_RESULT = 7;
......
#include "image_manager.h"
#include "game.h"
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD
#include <thread>
#endif
#ifdef _OPENMP
......@@ -22,7 +22,7 @@ bool ImageManager::Initial() {
tUnknownFit = nullptr;
tUnknownThumb = nullptr;
tBigPicture = nullptr;
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD
tLoading = nullptr;
tThumbLoadingThreadRunning = false;
#endif
......@@ -66,7 +66,7 @@ void ImageManager::ClearTexture() {
driver->removeTexture(tit->second);
}
for(auto tit = tThumb.begin(); tit != tThumb.end(); ++tit) {
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD
if(tit->second && tit->second != tLoading)
#else
if(tit->second)
......@@ -80,7 +80,7 @@ void ImageManager::ClearTexture() {
tMap[0].clear();
tMap[1].clear();
tThumb.clear();
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD
tThumbLoadingMutex.lock();
tThumbLoading.clear();
while(!tThumbLoadingCodes.empty())
......@@ -123,7 +123,7 @@ void ImageManager::ResizeTexture() {
driver->removeTexture(tUnknown);
driver->removeTexture(tUnknownFit);
driver->removeTexture(tUnknownThumb);
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD
driver->removeTexture(tLoading);
tLoading = GetTextureFromFile("textures/cover.jpg", imgWidthThumb, imgHeightThumb);
#endif
......@@ -298,7 +298,7 @@ irr::video::ITexture* ImageManager::GetBigPicture(int code, float zoom) {
tBigPicture = texture;
return texture;
}
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD
int ImageManager::LoadThumbThread() {
while(true) {
imageManager.tThumbLoadingMutex.lock();
......@@ -354,11 +354,11 @@ int ImageManager::LoadThumbThread() {
imageManager.tThumbLoadingMutex.unlock();
return 0;
}
#endif // YGOPRO_USE_THUMB_LOAD_THERAD
#endif // YGOPRO_USE_THUMB_LOAD_THREAD
irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
if(code == 0)
return tUnknownThumb;
#ifndef YGOPRO_USE_THUMB_LOAD_THERAD
#ifndef YGOPRO_USE_THUMB_LOAD_THREAD
auto tit = tThumb.find(code);
if(tit == tThumb.end()) {
char file[256];
......@@ -381,7 +381,7 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
tThumb[code] = img;
return (img == NULL) ? tUnknownThumb : img;
}
#else // YGOPRO_USE_THUMB_LOAD_THERAD
#else // YGOPRO_USE_THUMB_LOAD_THREAD
imageManager.tThumbLoadingMutex.lock();
auto lit = tThumbLoading.find(code);
if(lit != tThumbLoading.end()) {
......@@ -409,7 +409,7 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
imageManager.tThumbLoadingMutex.unlock();
return tLoading;
}
#endif // YGOPRO_USE_THUMB_LOAD_THERAD
#endif // YGOPRO_USE_THUMB_LOAD_THREAD
if(tit->second)
return tit->second;
else
......
......@@ -2,13 +2,13 @@
#define IMAGEMANAGER_H
#ifndef _OPENMP
#define YGOPRO_USE_THUMB_LOAD_THERAD
#define YGOPRO_USE_THUMB_LOAD_THREAD
#endif
#include "config.h"
#include "data_manager.h"
#include <unordered_map>
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD
#include <queue>
#include <mutex>
#endif
......@@ -27,14 +27,14 @@ public:
irr::video::ITexture* GetBigPicture(int code, float zoom);
irr::video::ITexture* GetTextureThumb(int code);
irr::video::ITexture* GetTextureField(int code);
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD
static int LoadThumbThread();
#endif
std::unordered_map<int, irr::video::ITexture*> tMap[2];
std::unordered_map<int, irr::video::ITexture*> tThumb;
std::unordered_map<int, irr::video::ITexture*> tFields;
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD
std::unordered_map<int, irr::video::IImage*> tThumbLoading;
std::queue<int> tThumbLoadingCodes;
std::mutex tThumbLoadingMutex;
......@@ -47,7 +47,7 @@ public:
irr::video::ITexture* tUnknownFit;
irr::video::ITexture* tUnknownThumb;
irr::video::ITexture* tBigPicture;
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD
irr::video::ITexture* tLoading;
#endif
irr::video::ITexture* tAct;
......
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