GPULamp *RAS_OpenGLLight::GetGPULamp() { KX_LightObject* kxlight = (KX_LightObject*)m_light; if (m_glsl) return GPU_lamp_from_blender(kxlight->GetScene()->GetBlenderScene(), kxlight->GetBlenderObject(), kxlight->GetBlenderGroupObject()); else return NULL; }
RAS_OpenGLLight::~RAS_OpenGLLight() { GPULamp *lamp; KX_LightObject *kxlight = (KX_LightObject *)m_light; Lamp *la = (Lamp *)kxlight->GetBlenderObject()->data; if ((lamp = GetGPULamp())) { float obmat[4][4] = {{0}}; GPU_lamp_update(lamp, 0, 0, obmat); GPU_lamp_update_distance(lamp, la->dist, la->att1, la->att2, la->coeff_const, la->coeff_lin, la->coeff_quad); GPU_lamp_update_spot(lamp, la->spotsize, la->spotblend); } }
Image *RAS_OpenGLLight::GetTextureImage(short texslot) { KX_LightObject *kxlight = (KX_LightObject *)m_light; Lamp *la = (Lamp *)kxlight->GetBlenderObject()->data; if (texslot >= MAX_MTEX || texslot < 0) { printf("KX_LightObject::GetTextureImage(): texslot exceeds slot bounds (0-%d)\n", MAX_MTEX - 1); return NULL; } if (la->mtex[texslot]) return la->mtex[texslot]->tex->ima; return NULL; }