mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-27 14:57:56 +00:00
GRIM: Configure lights when needed only.
This commit is contained in:
parent
5de874d511
commit
c6027194c6
@ -107,6 +107,7 @@ void Scene::loadText(TextSplitter &ts){
|
||||
_setups[i].load(ts);
|
||||
_currSetup = _setups;
|
||||
|
||||
_lightsConfigured = false;
|
||||
_numSectors = -1;
|
||||
_numLights = -1;
|
||||
_lights = NULL;
|
||||
@ -459,6 +460,9 @@ void Scene::Setup::setupCamera() const {
|
||||
}
|
||||
|
||||
void Scene::setupLights() {
|
||||
if (_lightsConfigured)
|
||||
return;
|
||||
_lightsConfigured = true;
|
||||
if (!_enableLights) {
|
||||
g_driver->disableLights();
|
||||
return;
|
||||
@ -478,6 +482,7 @@ void Scene::setSetup(int num) {
|
||||
}
|
||||
_currSetup = _setups + num;
|
||||
g_grim->flagRefreshShadowMask(true);
|
||||
_lightsConfigured = false;
|
||||
}
|
||||
|
||||
void Scene::drawBackground() const {
|
||||
@ -555,6 +560,7 @@ void Scene::setLightIntensity(const char *light, float intensity) {
|
||||
Light &l = _lights[i];
|
||||
if (l._name == light) {
|
||||
l._intensity = intensity;
|
||||
_lightsConfigured = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -563,6 +569,7 @@ void Scene::setLightIntensity(const char *light, float intensity) {
|
||||
void Scene::setLightIntensity(int light, float intensity) {
|
||||
Light &l = _lights[light];
|
||||
l._intensity = intensity;
|
||||
_lightsConfigured = false;
|
||||
}
|
||||
|
||||
void Scene::setLightPosition(const char *light, Graphics::Vector3d pos) {
|
||||
@ -570,6 +577,7 @@ void Scene::setLightPosition(const char *light, Graphics::Vector3d pos) {
|
||||
Light &l = _lights[i];
|
||||
if (l._name == light) {
|
||||
l._pos = pos;
|
||||
_lightsConfigured = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -578,6 +586,7 @@ void Scene::setLightPosition(const char *light, Graphics::Vector3d pos) {
|
||||
void Scene::setLightPosition(int light, Graphics::Vector3d pos) {
|
||||
Light &l = _lights[light];
|
||||
l._pos = pos;
|
||||
_lightsConfigured = false;
|
||||
}
|
||||
|
||||
void Scene::setSoundPosition(const char *soundName, Graphics::Vector3d pos) {
|
||||
|
@ -67,6 +67,7 @@ public:
|
||||
|
||||
void setLightEnableState(bool state) {
|
||||
_enableLights = state;
|
||||
_lightsConfigured = false;
|
||||
}
|
||||
void setLightIntensity(const char *light, float intensity);
|
||||
void setLightIntensity(int light, float intensity);
|
||||
@ -139,6 +140,7 @@ private:
|
||||
Sector **_sectors;
|
||||
Light *_lights;
|
||||
Setup *_setups;
|
||||
bool _lightsConfigured;
|
||||
public:
|
||||
Setup *_currSetup;
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user