From b54607bfc9b1c05a840a2220850d77deda221f81 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 24 Feb 2014 11:54:58 +0800 Subject: [PATCH] only using std::max for window. --- cocos/2d/CCSprite.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index f5b8337d9c..4b5ae03fe2 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -634,8 +634,13 @@ bool Sprite::culling() const y -= screen_half.height; // convert content size to world coordinates +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 float wchw = hcsx * std::max(fabsf(_modelViewTransform.mat[0] + _modelViewTransform.mat[4]), fabsf(_modelViewTransform.mat[0] - _modelViewTransform.mat[4])); float wchh = hcsy * std::max(fabsf(_modelViewTransform.mat[1] + _modelViewTransform.mat[5]), fabsf(_modelViewTransform.mat[1] - _modelViewTransform.mat[5])); +#else + float wchw = hcsx * fmaxf(fabsf(_modelViewTransform.mat[0] + _modelViewTransform.mat[4]), fabsf(_modelViewTransform.mat[0] - _modelViewTransform.mat[4])); + float wchh = hcsy * fmaxf(fabsf(_modelViewTransform.mat[1] + _modelViewTransform.mat[5]), fabsf(_modelViewTransform.mat[1] - _modelViewTransform.mat[5])); +#endif // compare if it in the positive quarter of the screen float tmpx = (fabsf(x)-wchw);