| 777 | |
| 778 | |
| 779 | static void writeDefaultOBJMaterials(std::ostream& out) { |
| 780 | typedef struct { |
| 781 | const char* name; |
| 782 | const char* texture; |
| 783 | fvec4 color; |
| 784 | } MatProps; |
| 785 | const MatProps defaultMats[] = { |
| 786 | {"ground", "ground.png", fvec4(0.5f, 0.5f, 0.5f, 1.0f)}, |
| 787 | {"boxtop", "roof.png", fvec4(1.0f, 1.0f, 0.9f, 1.0f)}, |
| 788 | {"boxwall", "boxwall.png", fvec4(1.0f, 0.9f, 0.8f, 1.0f)}, |
| 789 | {"pyrwall", "pyrwall.png", fvec4(0.8f, 0.8f, 1.0f, 1.0f)}, |
| 790 | {"telefront", "telelink.png", fvec4(1.0f, 0.0f, 0.0f, 0.5f)}, |
| 791 | {"teleback", "telelink.png", fvec4(0.0f, 1.0f, 0.0f, 0.5f)}, |
| 792 | {"telerim", "caution.png", fvec4(1.0f, 1.0f, 0.0f, 0.5f)}, |
| 793 | {"basetop_team1", "skins/red/basetop.png", fvec4(1.0f, 0.8f, 0.8f, 1.0f)}, |
| 794 | {"basewall_team1", "skins/red/basewall.png", fvec4(1.0f, 0.8f, 0.8f, 1.0f)}, |
| 795 | {"basetop_team2", "skins/green/basetop.png", fvec4(0.8f, 1.0f, 0.8f, 1.0f)}, |
| 796 | {"basewall_team2", "skins/green/basewall.png", fvec4(0.8f, 1.0f, 0.8f, 1.0f)}, |
| 797 | {"basetop_team3", "skins/blue/basetop.png", fvec4(0.8f, 0.8f, 1.0f, 1.0f)}, |
| 798 | {"basewall_team3", "skins/blue/basewall.png", fvec4(0.8f, 0.8f, 1.0f, 1.0f)}, |
| 799 | {"basetop_team4", "skins/purple/basetop.png", fvec4(1.0f, 0.8f, 1.0f, 1.0f)}, |
| 800 | {"basewall_team4", "skins/purple/basewall.png", fvec4(1.0f, 0.8f, 1.0f, 1.0f)} |
| 801 | }; |
| 802 | const int count = sizeof(defaultMats) / sizeof(defaultMats[0]); |
| 803 | BzMaterial mat; |
| 804 | for (int i = 0; i < count; i++) { |
| 805 | const MatProps& mp = defaultMats[i]; |
| 806 | mat.setName(mp.name); |
| 807 | mat.setTexture(mp.texture); |
| 808 | mat.setDiffuse(mp.color); |
| 809 | mat.printMTL(out, ""); |
| 810 | } |
| 811 | return; |
| 812 | } |
| 813 | |
| 814 | |
| 815 | static void writeOBJGround(std::ostream& out) { |
no test coverage detected