This commit is contained in:
Tim Felgentreff 2022-12-27 08:38:52 +01:00
commit 7f6cee72de
3 changed files with 25 additions and 0 deletions

View file

@ -77,6 +77,7 @@ public:
void SetFogColor(const uint8_t r, const uint8_t g, const uint8_t b);
void SetFogColor(const CColor color);
void SetEasingSteps(const uint8_t num);
void EnableBilinearUpscale(const bool enable);
bool IsBilinearUpscaleEnabled() const { return Settings.UpscaleType == UpscaleTypes::cBilinear; }

View file

@ -192,6 +192,12 @@ void CFogOfWar::SetFogColor(const CColor color)
Settings.FogColorSDL = (color.R << RSHIFT) | (color.G << GSHIFT) | (color.B << BSHIFT);
}
void CFogOfWar::SetEasingSteps(const uint8_t num)
{
Settings.NumOfEasingSteps = num;
FogTexture.SetNumOfSteps(num);
}
void CFogOfWar::Clean(const bool isHardClean /*= false*/)
{
if(isHardClean) {

View file

@ -673,6 +673,23 @@ static int CclSetFogOfWarColor(lua_State *l)
return 0;
}
/**
** Set nember of steps for Fog textures easing
**
** @param l Lua state.
*/
static int CclSetFogOfWarEasingSteps(lua_State *l)
{
std::string FogGraphicFile;
LuaCheckArgs(l, 1);
int numOfSteps = LuaToNumber(l, 1);
clamp(&numOfSteps, 1, 255);
FogOfWar->SetEasingSteps(numOfSteps);
return 0;
}
/**
** Define Fog graphics
**
@ -1070,6 +1087,7 @@ void MapCclRegister()
lua_register(Lua, "SetFogOfWarGraphics", CclSetFogOfWarGraphics);
lua_register(Lua, "SetFogOfWarColor", CclSetFogOfWarColor);
lua_register(Lua, "SetFogOfWarEasingSteps", CclSetFogOfWarEasingSteps);
lua_register(Lua, "SetMMFogOfWarOpacityLevels", CclSetMMFogOfWarOpacityLevels);