aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/lights.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/bladerunner/lights.cpp')
-rw-r--r--engines/bladerunner/lights.cpp161
1 files changed, 81 insertions, 80 deletions
diff --git a/engines/bladerunner/lights.cpp b/engines/bladerunner/lights.cpp
index 33ee3d1181..29e4c2f58e 100644
--- a/engines/bladerunner/lights.cpp
+++ b/engines/bladerunner/lights.cpp
@@ -1,100 +1,101 @@
#include "bladerunner/lights.h"
namespace BladeRunner {
- Lights::Lights(BladeRunnerEngine *vm)
- {
- _vm = vm;
- _ambientLightColor.r = 1.0;
- _ambientLightColor.g = 0.0;
- _ambientLightColor.b = 0.0;
+Lights::Lights(BladeRunnerEngine *vm)
+{
+ _vm = vm;
- _lights = NULL;
- _frame = 0;
- }
+ _ambientLightColor.r = 1.0;
+ _ambientLightColor.g = 0.0;
+ _ambientLightColor.b = 0.0;
- Lights::~Lights()
- {
- reset();
- }
+ _lights = NULL;
+ _frame = 0;
+}
- void Lights::read(Common::ReadStream* stream, int framesCount)
- {
- _ambientLightColor.r = stream->readFloatLE();
- _ambientLightColor.g = stream->readFloatLE();
- _ambientLightColor.b = stream->readFloatLE();
+Lights::~Lights()
+{
+ reset();
+}
- _lightsCount = stream->readUint32LE();
- int i;
- for (i = 0; i < _lightsCount; i++)
- {
- Light *light;
- int type = stream->readUint32LE();
- switch (type)
- {
- case 1:
- light = new Light1();
- break;
- case 2:
- light = new Light2();
- break;
- case 3:
- light = new Light3();
- break;
- case 4:
- light = new Light4();
- break;
- case 5:
- light = new Light5();
- break;
- default:
- light = new Light();
- }
-
- light->read(stream, framesCount, _frame, 0);
- light->_next = _lights;
- _lights = light;
- }
- }
+void Lights::read(Common::ReadStream* stream, int framesCount)
+{
+ _ambientLightColor.r = stream->readFloatLE();
+ _ambientLightColor.g = stream->readFloatLE();
+ _ambientLightColor.b = stream->readFloatLE();
- void Lights::readVqa(Common::ReadStream* stream)
+ _lightsCount = stream->readUint32LE();
+ int i;
+ for (i = 0; i < _lightsCount; i++)
{
- reset();
- //int framesCount = stream->readUint32LE();
- //int count = stream->readUint32LE();
+ Light *light;
+ int type = stream->readUint32LE();
+ switch (type)
+ {
+ case 1:
+ light = new Light1();
+ break;
+ case 2:
+ light = new Light2();
+ break;
+ case 3:
+ light = new Light3();
+ break;
+ case 4:
+ light = new Light4();
+ break;
+ case 5:
+ light = new Light5();
+ break;
+ default:
+ light = new Light();
+ }
+ light->read(stream, framesCount, _frame, 0);
+ light->_next = _lights;
+ _lights = light;
}
+}
- void Lights::setupFrame(int frame)
- {
- Light *light;
+void Lights::readVqa(Common::ReadStream* stream)
+{
+ reset();
+ //int framesCount = stream->readUint32LE();
+ //int count = stream->readUint32LE();
+}
- if (frame == _frame)
- return;
+void Lights::setupFrame(int frame)
+{
+ Light *light;
- if (!_lights)
- return;
+ if (frame == _frame)
+ return;
- for (light = _lights; light; light = light->_next)
- {
- light->setupFrame(frame);
- }
- }
+ if (!_lights)
+ return;
- void Lights::reset()
+ for (light = _lights; light; light = light->_next)
{
- Light *light;
- Light *nextLight;
+ light->setupFrame(frame);
+ }
+}
- if (!_lights)
- return;
+void Lights::reset()
+{
+ Light *light;
+ Light *nextLight;
- do
- {
- light = _lights;
- nextLight = light->_next;
- delete light;
- _lights = nextLight;
- } while (nextLight);
- }
-} \ No newline at end of file
+ if (!_lights)
+ return;
+
+ do
+ {
+ light = _lights;
+ nextLight = light->_next;
+ delete light;
+ _lights = nextLight;
+ } while (nextLight);
+}
+
+} // End of namespace BladeRunner