Cleaning up the memory bus and adding exception handling in the put pixel

This commit is contained in:
AnonymusRaccoon
2020-02-05 14:17:36 +01:00
parent e921306dcc
commit a0e6119841
9 changed files with 38 additions and 24 deletions
+6 -1
View File
@@ -25,8 +25,13 @@ namespace ComSquare::Renderer
this->window.display();
}
void SFRenderer::putPixel(int y, int x, uint32_t rgba)
void SFRenderer::putPixel(unsigned y, unsigned x, uint32_t rgba)
{
if (x >= this->videoMode.width)
throw InvalidPixelPosition("Width", x, this->videoMode.width);
if (y >= this->videoMode.height)
throw InvalidPixelPosition("Height", y, this->videoMode.height);
sf::Color pixels;
pixels.r = rgba >> 24U;
pixels.g = rgba >> 16U;