mirror of https://github.com/axmolengine/axmol.git
issue #2305: tab -> 4 spaces
This commit is contained in:
parent
ef7fd16f76
commit
b434190a70
|
@ -145,10 +145,10 @@ void TextureCache::addImageAsync(const char *path, Object *target, SEL_CallFuncO
|
|||
_asyncStructQueue = new queue<AsyncStruct*>();
|
||||
_imageInfoQueue = new queue<ImageInfo*>();
|
||||
|
||||
// create a new thread to load images
|
||||
// create a new thread to load images
|
||||
auto t = std::thread(&TextureCache::loadImage, this);
|
||||
t.detach();
|
||||
// should retain here, because sub thread use invoke TextureCache::loadImage()
|
||||
// should retain here, because sub thread use invoke TextureCache::loadImage()
|
||||
retain();
|
||||
|
||||
_needQuit = false;
|
||||
|
@ -237,9 +237,9 @@ void TextureCache::loadImage()
|
|||
pImageInfo->imageType = imageType;
|
||||
|
||||
// put the image info into the queue
|
||||
_imageInfoMutex.lock();
|
||||
_imageInfoMutex.lock();
|
||||
_imageInfoQueue->push(pImageInfo);
|
||||
_imageInfoMutex.unlock();
|
||||
_imageInfoMutex.unlock();
|
||||
}
|
||||
|
||||
if(_asyncStructQueue != nullptr)
|
||||
|
|
|
@ -153,12 +153,12 @@ public:
|
|||
|
||||
private:
|
||||
void addImageAsyncCallBack(float dt);
|
||||
void loadImage();
|
||||
Image::EImageFormat computeImageFormatType(std::string& filename);
|
||||
void loadImage();
|
||||
Image::EImageFormat computeImageFormatType(std::string& filename);
|
||||
|
||||
private:
|
||||
struct AsyncStruct
|
||||
{
|
||||
struct AsyncStruct
|
||||
{
|
||||
public:
|
||||
AsyncStruct(const std::string& fn, Object *t, SEL_CallFuncO s) : filename(fn), target(t), selector(s) {}
|
||||
|
||||
|
@ -167,7 +167,7 @@ private:
|
|||
SEL_CallFuncO selector;
|
||||
};
|
||||
|
||||
typedef struct _ImageInfo
|
||||
typedef struct _ImageInfo
|
||||
{
|
||||
AsyncStruct *asyncStruct;
|
||||
Image *image;
|
||||
|
@ -177,19 +177,19 @@ private:
|
|||
std::queue<AsyncStruct*>* _asyncStructQueue;
|
||||
std::queue<ImageInfo*>* _imageInfoQueue;
|
||||
|
||||
std::mutex _asyncStructQueueMutex;
|
||||
std::mutex _imageInfoMutex;
|
||||
std::mutex _asyncStructQueueMutex;
|
||||
std::mutex _imageInfoMutex;
|
||||
|
||||
std::mutex _sleepMutex;
|
||||
std::condition_variable _sleepCondition;
|
||||
std::mutex _sleepMutex;
|
||||
std::condition_variable _sleepCondition;
|
||||
|
||||
bool _needQuit;
|
||||
bool _needQuit;
|
||||
|
||||
int _asyncRefCount;
|
||||
int _asyncRefCount;
|
||||
|
||||
Dictionary* _textures;
|
||||
Dictionary* _textures;
|
||||
|
||||
static TextureCache *_sharedTextureCache;
|
||||
static TextureCache *_sharedTextureCache;
|
||||
};
|
||||
|
||||
#if CC_ENABLE_CACHE_TEXTURE_DATA
|
||||
|
|
Loading…
Reference in New Issue