Merge branch 'master' of https://github.com/Wargus/stratagus
This commit is contained in:
commit
7f6cee72de
3 changed files with 25 additions and 0 deletions
|
@ -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; }
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue