| 163 | } |
| 164 | |
| 165 | void TileRect::doRender() |
| 166 | { |
| 167 | if (!mVisible || mEmptyView || mTileSize.empty()) |
| 168 | return; |
| 169 | |
| 170 | VertexQuad* quad = reinterpret_cast<VertexQuad*>(mRenderItem->getCurrentVertexBuffer()); |
| 171 | |
| 172 | const RenderTargetInfo& info = mRenderItem->getRenderTarget()->getInfo(); |
| 173 | |
| 174 | // размер одного тайла |
| 175 | mRealTileWidth = info.pixScaleX * (float)(mTileSize.width) * 2; |
| 176 | mRealTileHeight = info.pixScaleY * (float)(mTileSize.height) * 2; |
| 177 | |
| 178 | mTextureHeightOne = (mCurrentTexture.bottom - mCurrentTexture.top) / mRealTileHeight; |
| 179 | mTextureWidthOne = (mCurrentTexture.right - mCurrentTexture.left) / mRealTileWidth; |
| 180 | |
| 181 | float vertex_z = mNode->getNodeDepth(); |
| 182 | |
| 183 | // абсолютный размер окна |
| 184 | float window_left = |
| 185 | ((info.pixScaleX * (float)(mCoord.left + mCroppedParent->getAbsoluteLeft() - info.leftOffset) + |
| 186 | info.hOffset) * |
| 187 | 2) - |
| 188 | 1; |
| 189 | float window_top = -( |
| 190 | ((info.pixScaleY * (float)(mCoord.top + mCroppedParent->getAbsoluteTop() - info.topOffset) + info.vOffset) * |
| 191 | 2) - |
| 192 | 1); |
| 193 | |
| 194 | // размер вьюпорта |
| 195 | float real_left = |
| 196 | ((info.pixScaleX * (float)(mCurrentCoord.left + mCroppedParent->getAbsoluteLeft() - info.leftOffset) + |
| 197 | info.hOffset) * |
| 198 | 2) - |
| 199 | 1; |
| 200 | float real_right = real_left + (info.pixScaleX * (float)mCurrentCoord.width * 2); |
| 201 | float real_top = |
| 202 | -(((info.pixScaleY * (float)(mCurrentCoord.top + mCroppedParent->getAbsoluteTop() - info.topOffset) + |
| 203 | info.vOffset) * |
| 204 | 2) - |
| 205 | 1); |
| 206 | float real_bottom = real_top - (info.pixScaleY * (float)mCurrentCoord.height * 2); |
| 207 | |
| 208 | size_t count = 0; |
| 209 | |
| 210 | float bottom = window_top; |
| 211 | |
| 212 | for (int y = 0; y < mCoord.height; y += mTileSize.height) |
| 213 | { |
| 214 | float top = bottom; |
| 215 | bottom -= mRealTileHeight; |
| 216 | float right = window_left; |
| 217 | |
| 218 | float vertex_top = top; |
| 219 | float vertex_bottom = bottom; |
| 220 | bool texture_crop_height = false; |
| 221 | |
| 222 | if (vertex_top > real_top) |
nothing calls this directly
no test coverage detected