diff options
author | Perttu Ahola <celeron55@gmail.com> | 2010-12-23 22:35:53 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2010-12-23 22:35:53 +0200 |
commit | 10b06419ab454e8931a9b6502029bc298e8bce35 (patch) | |
tree | f8dedc838957537e0ee9efc627c695afccb3c9f2 /src/irrlichtwrapper.cpp | |
parent | 61b5a353849f8c8a188c4f91c1aa89c9e7a1d10a (diff) | |
download | minetest-10b06419ab454e8931a9b6502029bc298e8bce35.tar.gz minetest-10b06419ab454e8931a9b6502029bc298e8bce35.tar.bz2 minetest-10b06419ab454e8931a9b6502029bc298e8bce35.zip |
changes to handing of digging (non backwards-compatible i guess)
Diffstat (limited to 'src/irrlichtwrapper.cpp')
-rw-r--r-- | src/irrlichtwrapper.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/irrlichtwrapper.cpp b/src/irrlichtwrapper.cpp index 51511eb34..c012b136e 100644 --- a/src/irrlichtwrapper.cpp +++ b/src/irrlichtwrapper.cpp @@ -51,16 +51,25 @@ video::ITexture* IrrlichtWrapper::getTexture(TextureSpec spec) // Throw a request in m_get_texture_queue.add(spec, 0, 0, &result_queue); - dstream<<"Waiting for texture "<<spec.name<<std::endl; - - // Wait result - GetResult<TextureSpec, video::ITexture*, u8, u8> - result = result_queue.pop_front(1000); + dstream<<"Waiting for texture from main thread: " + <<spec.name<<std::endl; - // Check that at least something worked OK - assert(result.key.name == spec.name); - - t = result.item; + try + { + // Wait result for a second + GetResult<TextureSpec, video::ITexture*, u8, u8> + result = result_queue.pop_front(1000); + + // Check that at least something worked OK + assert(result.key.name == spec.name); + + t = result.item; + } + catch(ItemNotFoundException &e) + { + dstream<<"Waiting for texture timed out."<<std::endl; + t = NULL; + } } // Add to cache and return |