diff --git a/components/nif/effect.cpp b/components/nif/effect.cpp index 78feeea94..79cd10431 100644 --- a/components/nif/effect.cpp +++ b/components/nif/effect.cpp @@ -55,4 +55,12 @@ void NiPointLight::read(NIFStream *nif) quadraticAttenuation = nif->getFloat(); } +void NiSpotLight::read(NIFStream *nif) +{ + NiPointLight::read(nif); + + cutoff = nif->getFloat(); + exponent = nif->getFloat(); +} + } diff --git a/components/nif/effect.hpp b/components/nif/effect.hpp index 75de0a9ab..02647e444 100644 --- a/components/nif/effect.hpp +++ b/components/nif/effect.hpp @@ -60,6 +60,13 @@ struct NiPointLight : public NiLight void read(NIFStream *nif); }; +struct NiSpotLight : public NiPointLight +{ + float cutoff; + float exponent; + void read(NIFStream *nif); +}; + struct NiTextureEffect : NiDynamicEffect { NiSourceTexturePtr texture; diff --git a/components/nif/niffile.cpp b/components/nif/niffile.cpp index ab0af8f99..ccfcdfc73 100644 --- a/components/nif/niffile.cpp +++ b/components/nif/niffile.cpp @@ -83,6 +83,7 @@ static std::map makeFactory() newFactory.insert(makeEntry("NiAmbientLight", &construct , RC_NiLight )); newFactory.insert(makeEntry("NiDirectionalLight", &construct , RC_NiLight )); newFactory.insert(makeEntry("NiPointLight", &construct , RC_NiLight )); + newFactory.insert(makeEntry("NiSpotLight", &construct , RC_NiLight )); newFactory.insert(makeEntry("NiTextureEffect", &construct , RC_NiTextureEffect )); newFactory.insert(makeEntry("NiVertWeightsExtraData", &construct , RC_NiVertWeightsExtraData )); newFactory.insert(makeEntry("NiTextKeyExtraData", &construct , RC_NiTextKeyExtraData ));