Circular-Studios/Dash — pull request #110 by NCrashed (2014-03-30 11:41:10+00:00)
Title: Linux. Runtime fails

While building under linux platform one should note:
* You need latest version of `freeimage`:
If you use repo version of freeimage (my was 3.10.0, but 3.16 required) or you will get "cannot load `Has_Pixels` symbol" error. Note: there is idea to catch derelict load exceptions for unused new features.
* You need latest `assimp` version:
I got segfault while initializing, here core dump:
```
#0 0x00000000005d2e35 in components.assets.AssetManager.initialize() (this=0x7ffff7ed4fc0) at source/components/assets.d:66
#1 0x00000000005bc3b0 in core.dgame.DGame.start() (this=0x7ffff7ed4f80) at source/core/dgame.d:198
#2 0x00000000005bbc5c in core.dgame.DGame.run() (this=0x7ffff7ed4f80) at source/core/dgame.d:53
#3 0x00000000005ba324 in D main () at ../Dash/source/app.d:23
#4 0x000000000067b824 in rt.dmain2._d_run_main() ()
#5 0x000000000067b77e in rt.dmain2._d_run_main() ()
#6 0x000000000067b7e4 in rt.dmain2._d_run_main() ()
#7 0x000000000067b77e in rt.dmain2._d_run_main() ()
#8 0x000000000067b6ff in _d_run_main ()
#9 0x00000000005ba34d in main ()
```

I found that `aiImportFile` returns `null` at `source/components/assets.d:60`. There is lack of enforce check for successful load and `assimp` support for `.fbx` format.

And finally, some .yml files have several objects and game fails in initialization phase with:
```
[INFO] Initializing...
[INFO] Graphics initialization:
[INFO] ../Shaders does not exist.
[INFO] Graphics init time: 422 ms, 959 μs, and 4 hnsecs
[INFO] Assets initialization:
[INFO] Assets init time: 35 secs, 196 ms, and 246 μs
dyaml.node.NodeException@../../../.dub/packages/dyaml-master/source/dyaml/node.d(1815): Indexing a sequence with a non-integral type.
Node at: line 1,column 1
----------------
./sample-dash-game(ref @trusted dyaml.node.Node dyaml.node.Node.opIndex!(immutable(char)[]).opIndex(immutable(char)[])+0x79) [0x5ab9b1]
./sample-dash-game(shared(void function()) core.prefabs.PrefabManager.initialize+0x181) [0x5c02b9]
./sample-dash-game(shared(void function()) core.dgame.DGame.start+0x1a3) [0x5bd0bb]
./sample-dash-game(shared(void function()) core.dgame.DGame.run+0x6c) [0x5bc8fc]
./sample-dash-game(_Dmain+0x34) [0x5bafc4]
./sample-dash-game(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll().void __lambda1()+0x18) [0x67cf58]
./sample-dash-game(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x67ceb2]
./sample-dash-game(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll()+0x30) [0x67cf18]
./sample-dash-game(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x67ceb2]
./sample-dash-game(_d_run_main+0x1a3) [0x67ce33]
./sample-dash-game(main+0x25) [0x5bafed]
```
fd406f0 commit fixes the problem.

P.S.
====
There is useful functions for C<->D string conversions:
* std.string.toStringz
* custom made fromStringz