Commit 53da6ba
committed
bugfix(w3d): Load background textures when no loader thread is running
ThreadClass::Execute() starts nothing on Unix-like platforms - its _UNIX branch
returns immediately - so the web build has no texture loader thread. Everything
pushed to the background queue stayed there forever: those textures never
finished loading, and the engine kept drawing the missing-texture placeholder,
which is why terrain and units came out magenta.
Do the loader thread's work from TextureLoader::Update when the thread is not
running: pop each background task, Load() it, and hand it to the foreground queue
exactly as the thread would. No background lock is taken, because without a
second thread there is nobody to contend with. Guarded to Emscripten, so
platforms whose loader thread does run are untouched.1 parent 755d205 commit 53da6ba
1 file changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1472 | 1472 | | |
1473 | 1473 | | |
1474 | 1474 | | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
1475 | 1493 | | |
1476 | 1494 | | |
1477 | 1495 | | |
| |||
0 commit comments