DistanceFog imps

This commit is contained in:
Phillip Stephens 2016-08-08 13:55:58 -07:00
parent 2d73c8226c
commit 30bdf02b0e
4 changed files with 84 additions and 1 deletions

View File

@ -46,6 +46,7 @@ set(WORLD_SOURCES
CScriptCameraBlurKeyframe.hpp CScriptCameraBlurKeyframe.cpp
CScriptDamageableTrigger.hpp CScriptDamageableTrigger.cpp
CScriptDebris.hpp CScriptDebris.cpp
CScriptDistanceFog.hpp CScriptDistanceFog.cpp
CScriptActorRotate.hpp CScriptActorRotate.cpp
CScriptSpecialFunction.hpp CScriptSpecialFunction.cpp
CGrappleParameters.hpp

View File

@ -0,0 +1,22 @@
#include "CScriptDistanceFog.hpp"
namespace urde
{
CScriptDistanceFog::CScriptDistanceFog(TUniqueId uid, const std::string& name, const CEntityInfo& info,
const ERglFogMode& mode, const zeus::CColor& col,
const zeus::CVector2f& v1, float f1, const zeus::CVector2f& v2,
bool b1, bool active, float f2, float f3, float f4, float f5)
: CEntity(uid, info, active, name),
x34_mode(mode),
x38_col(col),
x3c_(v1),
x44_(f1),
x48_(v2),
x50_(f2),
x54_(f3),
x58_(f4),
x5c_(f5)
{
}
}

View File

@ -0,0 +1,29 @@
#ifndef __URDE_CSCRIPTDISTANCEFOG_HPP__
#define __URDE_CSCRIPTDISTANCEFOG_HPP__
#include "Graphics/CGraphics.hpp"
#include "CEntity.hpp"
namespace urde
{
class CScriptDistanceFog : public CEntity
{
ERglFogMode x34_mode;
zeus::CColor x38_col;
zeus::CVector2f x3c_;
float x44_;
zeus::CVector2f x48_;
float x50_;
float x54_;
float x58_;
float x5c_;
bool x60_;
bool x61_;
public:
CScriptDistanceFog(TUniqueId, const std::string&, const CEntityInfo&, const ERglFogMode&,
const zeus::CColor&, const zeus::CVector2f&, float, const zeus::CVector2f&,
bool, bool, float, float, float, float);
};
}
#endif // __URDE_CSCRIPTDISTANCEFOG_HPP__

View File

@ -39,6 +39,7 @@
#include "CScriptCameraBlurKeyframe.hpp"
#include "CScriptDamageableTrigger.hpp"
#include "CScriptDebris.hpp"
#include "CScriptDistanceFog.hpp"
#include "CScriptActorRotate.hpp"
#include "CScriptSpecialFunction.hpp"
#include "Camera/CCinematicCamera.hpp"
@ -1452,7 +1453,37 @@ CEntity* ScriptLoader::LoadPuddleToadGamma(CStateManager& mgr, CInputStream& in,
CEntity* ScriptLoader::LoadDistanceFog(CStateManager& mgr, CInputStream& in,
int propCount, const CEntityInfo& info)
{
if (!EnsurePropertyCount(propCount, 8, "DistanceFog"))
return nullptr;
const std::string* name = mgr.HashInstanceName(in);
u32 mode = in.readUint32Big();
zeus::CColor col;
col.readRGBABig(in);
zeus::CVector2f vec1;
vec1.readBig(in);
float f1 = in.readFloatBig();
zeus::CVector2f vec2;
vec2.readBig(in);
bool b1 = in.readBool();
bool active = in.readBool();
ERglFogMode realMode;
if (mode == 0)
realMode = ERglFogMode::None;
else if (mode == 1)
realMode = ERglFogMode::PerspLin;
else if (mode == 2)
realMode = ERglFogMode::PerspExp;
else if (mode == 3)
realMode = ERglFogMode::PerspExp2;
else if (mode == 4)
realMode = ERglFogMode::PerspRevExp;
else if (mode == 5)
realMode = ERglFogMode::PerspRevExp2;
return new CScriptDistanceFog(mgr.AllocateUniqueId(), name, info, realMode, col, vec1, f1, vec2, b1, active,
0.f, 0.f, 0.f, 0.f);
}
CEntity* ScriptLoader::LoadFireFlea(CStateManager& mgr, CInputStream& in,