fixed misleading x and y

This commit is contained in:
Clément Le Bihan
2020-02-05 11:07:39 +01:00
parent 3706e59d54
commit 3282944c75
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ int main(int argc, char **argv)
bus.mapComponents(snes);
int incx = 0;
int incy = 0;
uint32_t pixel = 0xFF0000FF;
uint32_t pixel = 0xFFFF00FF;
while (!renderer.shouldExit) {
renderer.putPixel(incy, incx++, pixel);
+2 -2
View File
@@ -25,14 +25,14 @@ namespace ComSquare::Renderer
this->renderer.display();
}
void SFRenderer::putPixel(int x, int y, uint32_t rgba)
void SFRenderer::putPixel(int y, int x, uint32_t rgba)
{
sf::Color pixels;
pixels.r = rgba >> 24U;
pixels.g = rgba >> 16U;
pixels.b = rgba >> 8U;
pixels.a = rgba >> 0U;
this->pixelBuffer[this->videoMode.width * x + y] = pixels;
this->pixelBuffer[this->videoMode.width * y + x] = pixels;
}
SFRenderer::SFRenderer(unsigned int height, unsigned int width, int maxFPS)
+1 -1
View File
@@ -36,7 +36,7 @@ namespace ComSquare::Renderer
//! @param X horizontal index.
//! @param Y vertical index.
//! @param rgba The color of the pixel.
void putPixel(int x, int y, uint32_t rgba) override ;
void putPixel(int y, int x, uint32_t rgba) override ;
//! @brief Get the inputs from the Window
void getEvents();
//! @brief Constructor that return the window component of the SFML.