| 38 |
|
|
| 39 |
private static Queue<VObject> objectModQueue = new Queue<VObject>(); |
private static Queue<VObject> objectModQueue = new Queue<VObject>(); |
| 40 |
private static Queue<VObject> UnAssignedChildObjectModQueue = new Queue<VObject>(); |
private static Queue<VObject> UnAssignedChildObjectModQueue = new Queue<VObject>(); |
| 41 |
|
private static Queue<TextureComplete> assignTextureQueue = new Queue<TextureComplete>(); |
| 42 |
|
|
| 43 |
|
|
| 44 |
private static Simulator currentSim; |
private static Simulator currentSim; |
| 45 |
|
|
| 244 |
device.OnEvent += new OnEventDelegate(device_OnEvent); |
device.OnEvent += new OnEventDelegate(device_OnEvent); |
| 245 |
|
|
| 246 |
if (loadTextures) |
if (loadTextures) |
| 247 |
|
{ |
| 248 |
textureMan = new TextureManager(device, driver, "IdealistCache", avatarConnection); |
textureMan = new TextureManager(device, driver, "IdealistCache", avatarConnection); |
| 249 |
|
textureMan.OnTextureLoaded += textureCompleteCallback; |
| 250 |
|
} |
| 251 |
|
|
| 252 |
//guienv.AddStaticText("Hello World! This is the Irrlicht Software engine!", |
//guienv.AddStaticText("Hello World! This is the Irrlicht Software engine!", |
| 253 |
// new Rect(new Position2D(10, 10), new Dimension2D(200, 22)), true, false, guienv.RootElement, -1, false); |
// new Rect(new Position2D(10, 10), new Dimension2D(200, 22)), true, false, guienv.RootElement, -1, false); |
| 365 |
{ |
{ |
| 366 |
doObjectMods(5); |
doObjectMods(5); |
| 367 |
CheckAndApplyParent(5); |
CheckAndApplyParent(5); |
| 368 |
|
doTextureMods(); |
| 369 |
} |
} |
| 370 |
//Thread.Sleep(50); |
//Thread.Sleep(50); |
| 371 |
int frameTime = System.Environment.TickCount - tickcount; |
int frameTime = System.Environment.TickCount - tickcount; |
| 378 |
|
|
| 379 |
} |
} |
| 380 |
|
|
| 381 |
|
private void doTextureMods() |
| 382 |
|
{ |
| 383 |
|
lock (assignTextureQueue) |
| 384 |
|
{ |
| 385 |
|
while (assignTextureQueue.Count > 0) |
| 386 |
|
{ |
| 387 |
|
TextureComplete tx = assignTextureQueue.Dequeue(); |
| 388 |
|
Texture tex = driver.GetTexture(tx.texture); |
| 389 |
|
if (tx.node != null) |
| 390 |
|
{ |
| 391 |
|
textureMan.applyTexture(tex, tx.node); |
| 392 |
|
} |
| 393 |
|
} |
| 394 |
|
} |
| 395 |
|
} |
| 396 |
|
|
| 397 |
|
|
| 398 |
#region Object Management |
#region Object Management |
| 399 |
public void enqueueVObject(VObject newObject) |
public void enqueueVObject(VObject newObject) |
| 1664 |
|
|
| 1665 |
#endregion |
#endregion |
| 1666 |
|
|
| 1667 |
|
public void textureCompleteCallback(string tex, SceneNode node) |
| 1668 |
|
{ |
| 1669 |
|
TextureComplete tx = new TextureComplete(); |
| 1670 |
|
tx.texture = tex; |
| 1671 |
|
tx.node = node; |
| 1672 |
|
assignTextureQueue.Enqueue(tx); |
| 1673 |
|
} |
| 1674 |
|
} |
| 1675 |
|
|
| 1676 |
|
public struct TextureComplete |
| 1677 |
|
{ |
| 1678 |
|
public SceneNode node; |
| 1679 |
|
public string texture; |
| 1680 |
|
|
| 1681 |
} |
} |
| 1682 |
} |
} |