# HG changeset patch # User John Tsiombikas # Date 1385532539 -7200 # Node ID 25bf39105c82b47ac442cadca4aa626ae625a872 # Parent 1868c5975f318fb6196298a69a42081fd1e08428 lalal diff -r 1868c5975f31 -r 25bf39105c82 .hgignore --- a/.hgignore Sun Nov 24 18:18:38 2013 +0200 +++ b/.hgignore Wed Nov 27 08:08:59 2013 +0200 @@ -8,3 +8,5 @@ \.ncb$ \.suo$ \.user$ +^Makefile$ +src/config\.h$ diff -r 1868c5975f31 -r 25bf39105c82 src/goat3dgfx.cc --- a/src/goat3dgfx.cc Sun Nov 24 18:18:38 2013 +0200 +++ b/src/goat3dgfx.cc Wed Nov 27 08:08:59 2013 +0200 @@ -21,4 +21,5 @@ void shutdown_goat_graphics() { + vr_shutdown(); } diff -r 1868c5975f31 -r 25bf39105c82 src/scene.cc --- a/src/scene.cc Sun Nov 24 18:18:38 2013 +0200 +++ b/src/scene.cc Wed Nov 27 08:08:59 2013 +0200 @@ -2,6 +2,8 @@ #include "opengl.h" #include "goat3d.h" +static Mesh *load_mesh(goat3d_mesh *gmesh); + Scene::~Scene() { destroy(); @@ -38,7 +40,10 @@ int num_meshes = goat3d_get_mesh_count(goat); for(int i=0; iset_name(name); + } + + mesh->set_attrib_data(MESH_ATTR_VERTEX, 3, nverts, data); + + if((data = (float*)goat3d_get_mesh_attribs(gmesh, GOAT3D_MESH_ATTR_NORMAL))) { + mesh->set_attrib_data(MESH_ATTR_NORMAL, 3, nverts, data); + } + if((data = (float*)goat3d_get_mesh_attribs(gmesh, GOAT3D_MESH_ATTR_TANGENT))) { + mesh->set_attrib_data(MESH_ATTR_TANGENT, 3, nverts, data); + } + if((data = (float*)goat3d_get_mesh_attribs(gmesh, GOAT3D_MESH_ATTR_TEXCOORD))) { + mesh->set_attrib_data(MESH_ATTR_TEXCOORD, 2, nverts, data); + } + if((data = (float*)goat3d_get_mesh_attribs(gmesh, GOAT3D_MESH_ATTR_COLOR))) { + mesh->set_attrib_data(MESH_ATTR_COLOR, 4, nverts, data); + } + if((data = (float*)goat3d_get_mesh_attribs(gmesh, GOAT3D_MESH_ATTR_SKIN_WEIGHT))) { + mesh->set_attrib_data(MESH_ATTR_BONEWEIGHTS, 4, nverts, data); + } + int *idata = (int*)goat3d_get_mesh_attribs(gmesh, GOAT3D_MESH_ATTR_SKIN_MATRIX); + if(idata) { + for(int i=0; iset_attrib(MESH_ATTR_BONEIDX, i, Vector4(idata[0], idata[1], idata[2], idata[3])); + idata += 4; + } + } + + if(nfaces && !(idata = goat3d_get_mesh_faces(gmesh))) { + mesh->set_index_data(nfaces * 3, (unsigned int*)idata); + } + return mesh; +}