Make objects lit by default if there is a light in the scene, and no other face information exists for that object.

This commit is contained in:
Kester Maddock
2004-12-01 08:43:02 +00:00
parent 8b9de908bb
commit d098d94372

View File

@@ -160,6 +160,8 @@
#include "BL_ArmatureObject.h"
#include "BL_DeformableGameObject.h"
static int default_face_mode = TF_DYNAMIC;
static unsigned int KX_rgbaint2uint_new(unsigned int icol)
{
union
@@ -197,6 +199,21 @@ static unsigned int KX_Mcol2uint_new(MCol col)
return out_colour.integer;
}
static void SetDefaultFaceType(Scene* scene)
{
default_face_mode = TF_DYNAMIC;
Base *base = static_cast<Base*>(scene->base.first);
while(base)
{
if (base->object->type == OB_LAMP)
{
default_face_mode = TF_DYNAMIC|TF_LIGHT;
return;
}
base = base->next;
}
}
RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* rendertools, KX_Scene* scene, KX_BlenderSceneConverter *converter)
{
RAS_MeshObject *meshobj;
@@ -332,7 +349,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools*
// If there are no vertex colors OR texfaces,
// Initialize face to white and set COLLSION true and everything else FALSE
unsigned int colour = 0xFFFFFFFFL;
mode = TF_DYNAMIC;
mode = default_face_mode;
transp = TF_SOLID;
tile = 0;
if (ma)
@@ -1077,6 +1094,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
logicmgr->RegisterActionName(curAct->id.name, curAct);
}
SetDefaultFaceType(blenderscene);
Base *base = static_cast<Base*>(blenderscene->base.first);
while(base)
{