mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 14:49:40 +00:00
Clamp fallback value from config
This commit is contained in:
parent
079c77ff22
commit
5c6ca82c45
1 changed files with 4 additions and 0 deletions
|
@ -528,6 +528,8 @@ void Water::createSimpleWaterStateSet(osg::Node* node, float alpha)
|
||||||
// Add animated textures
|
// Add animated textures
|
||||||
std::vector<osg::ref_ptr<osg::Texture2D> > textures;
|
std::vector<osg::ref_ptr<osg::Texture2D> > textures;
|
||||||
int frameCount = Fallback::Map::getInt("Water_SurfaceFrameCount");
|
int frameCount = Fallback::Map::getInt("Water_SurfaceFrameCount");
|
||||||
|
frameCount = std::min(std::max(frameCount, 0), 320);
|
||||||
|
|
||||||
const std::string& texture = Fallback::Map::getString("Water_SurfaceTexture");
|
const std::string& texture = Fallback::Map::getString("Water_SurfaceTexture");
|
||||||
for (int i=0; i<frameCount; ++i)
|
for (int i=0; i<frameCount; ++i)
|
||||||
{
|
{
|
||||||
|
@ -644,6 +646,8 @@ Water::~Water()
|
||||||
void Water::listAssetsToPreload(std::vector<std::string> &textures)
|
void Water::listAssetsToPreload(std::vector<std::string> &textures)
|
||||||
{
|
{
|
||||||
int frameCount = Fallback::Map::getInt("Water_SurfaceFrameCount");
|
int frameCount = Fallback::Map::getInt("Water_SurfaceFrameCount");
|
||||||
|
frameCount = std::min(std::max(frameCount, 0), 320);
|
||||||
|
|
||||||
const std::string& texture = Fallback::Map::getString("Water_SurfaceTexture");
|
const std::string& texture = Fallback::Map::getString("Water_SurfaceTexture");
|
||||||
for (int i=0; i<frameCount; ++i)
|
for (int i=0; i<frameCount; ++i)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue