Skip to content

Commit b4bc499

Browse files
committed
Cancel narrow init of cocos2d::Texture2D::TexParams in water.cpp
1 parent b4ac98d commit b4bc499

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

frameworks/cocos2d-x/cocos/custom/Water.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ Water *Water::create(const std::string& tex1,const std::string& tex2,const std::
1919
auto wave2 = TexCache->addImage(tex2);
2020
auto wave1 = TexCache->addImage(tex3);
2121

22-
wave1->setTexParameters(cocos2d::Texture2D::TexParams{GL_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT});
23-
wave2->setTexParameters(cocos2d::Texture2D::TexParams{GL_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT});
22+
cocos2d::Texture2D::TexParams wave1TexParams = {GL_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT};
23+
cocos2d::Texture2D::TexParams wave2TexParams = {GL_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT};
24+
wave1->setTexParameters(wave1TexParams);
25+
wave2->setTexParameters(wave2TexParams);
2426
auto glprogram = cocos2d::GLProgram::createWithFilenames("res/shader3D/water.vsh", "res/shader3D/water.fsh");
2527
auto glprogramstate = cocos2d::GLProgramState::getOrCreateWithGLProgram(glprogram);
2628
water->setGLProgramState(glprogramstate);

0 commit comments

Comments
 (0)