static errcode GetDirLight(parsehandle * ph, SceneHandle scene) { char tmp[255]; apivector dir; apitexture tex; float r, g, b; errcode rc; memset(&tex, 0, sizeof(apitexture)); rc = GetString(ph, "DIRECTION"); rc |= GetVector(ph, &dir); fscanf(ph->ifp, "%s", tmp); if (!stringcmp(tmp, "COLOR")) { fscanf(ph->ifp, "%f %f %f", &r, &g, &b); tex.col.r=r; tex.col.g=g; tex.col.b=b; rt_directional_light(scene, rt_texture(scene, &tex), dir); } return rc; }
void * rt_directional_light3fv(SceneHandle voidscene, void * tex, const float *dir) { vector vdir; vdir.x = dir[0]; vdir.y = dir[1]; vdir.z = dir[2]; return rt_directional_light(voidscene, tex, vdir); }