only using std::max for window.

This commit is contained in:
Dhilan007 2014-02-24 11:54:58 +08:00
parent d6cd2eb05f
commit b54607bfc9
1 changed files with 5 additions and 0 deletions

View File

@ -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);