void thread_LoadTexture(SceneNode node, string path, Dimension2Di size) { Texture t; Dimension2Di si; Image i = irrDevice.DriverNoCheck.CreateImage(path); if (i != null) { Image j = irrDevice.DriverNoCheck.CreateImage(ColorFormat.A8R8G8B8, size); i.CopyToScaling(j); irrDevice.Lock(); t = irrDevice.Driver.AddTexture(path + "|" + size.ToString(), j); irrDevice.Unlock(); si = i.Dimension; i.Drop(); j.Drop(); lock (loadedTextures) { loadedTextures.Add(t.Name.Path); } } else { t = noPreviewTexture; si = noPreviewTexture.Size; } irrDevice.Lock(); node.SetMaterialTexture(0, t); irrDevice.Unlock(); if (OnTextureLoaded != null) { OnTextureLoaded(node, t, si); } node.Drop(); }
void thread_LoadTexture(SceneNode node, string path, Dimension2Di size) { Texture t; Dimension2Di si; Image i = irrDevice.DriverNoCheck.CreateImage(path); if (i != null) { Image j = irrDevice.DriverNoCheck.CreateImage(ColorFormat.A8R8G8B8, size); i.CopyToScaling(j); irrDevice.Lock(); t = irrDevice.Driver.AddTexture(path + "|" + size.ToString(), j); irrDevice.Unlock(); si = i.Dimension; i.Drop(); j.Drop(); lock (loadedTextures) { loadedTextures.Add(t.Name.Path); } } else { t = noPreviewTexture; si = noPreviewTexture.Size; } irrDevice.Lock(); node.SetMaterialTexture(0, t); irrDevice.Unlock(); if (OnTextureLoaded != null) OnTextureLoaded(node, t, si); node.Drop(); }