| 160 | } |
| 161 | |
| 162 | void CGameItem::Draw(int x, int y) |
| 163 | { |
| 164 | ScopedPerfMarker(__FUNCTION__); |
| 165 | |
| 166 | if (Container == 0xFFFFFFFF) |
| 167 | { |
| 168 | if (MultiBody) |
| 169 | { |
| 170 | RenderGraphic = MultiTileGraphic; |
| 171 | |
| 172 | if (RenderGraphic != 0u) |
| 173 | { |
| 174 | if (!Locked() && g_SelectedObject.Object == this) |
| 175 | { |
| 176 | RenderColor = 0x0035; |
| 177 | } |
| 178 | else |
| 179 | { |
| 180 | RenderColor = Color; |
| 181 | } |
| 182 | |
| 183 | CRenderStaticObject::Draw(x, y); |
| 184 | } |
| 185 | |
| 186 | return; |
| 187 | } |
| 188 | |
| 189 | g_RenderedObjectsCountInGameWindow++; |
| 190 | |
| 191 | bool useAlpha = (m_DrawTextureColor[3] != 0xFF); |
| 192 | |
| 193 | if (useAlpha) |
| 194 | { |
| 195 | #ifndef NEW_RENDERER_ENABLED |
| 196 | glEnable(GL_BLEND); |
| 197 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
| 198 | glColor4ub( |
| 199 | m_DrawTextureColor[0], |
| 200 | m_DrawTextureColor[1], |
| 201 | m_DrawTextureColor[2], |
| 202 | m_DrawTextureColor[3]); |
| 203 | #else |
| 204 | RenderAdd_SetBlend( |
| 205 | g_renderCmdList, |
| 206 | BlendStateCmd{ BlendFactor::BlendFactor_SrcAlpha, |
| 207 | BlendFactor::BlendFactor_OneMinusSrcAlpha }); |
| 208 | RenderAdd_SetColor( |
| 209 | g_renderCmdList, |
| 210 | SetColorCmd{ { m_DrawTextureColor[0] / 255.f, |
| 211 | m_DrawTextureColor[1] / 255.f, |
| 212 | m_DrawTextureColor[2] / 255.f, |
| 213 | m_DrawTextureColor[3] / 255.f } }); |
| 214 | #endif |
| 215 | } |
| 216 | |
| 217 | if (IsCorpse()) |
| 218 | { //Трупик |
| 219 | g_AnimationManager.DrawCorpse(this, x, y - 3); |
no test coverage detected