From b69cf39449a6c11e290d448b014bae630c0913ce Mon Sep 17 00:00:00 2001 From: Scott Freeman Date: Mon, 26 Apr 2021 11:44:30 -0400 Subject: [PATCH] Mod by 256 to full uint8_t range --- Videos/CarCrimeCity/Part1/olcPixelGameEngine.h | 2 +- Videos/CarCrimeCity/Part2/olcPixelGameEngine.h | 2 +- Videos/SavingSedit/olcPixelGameEngine.h | 2 +- olcExampleProgram.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Videos/CarCrimeCity/Part1/olcPixelGameEngine.h b/Videos/CarCrimeCity/Part1/olcPixelGameEngine.h index 0c524ac..595aa70 100644 --- a/Videos/CarCrimeCity/Part1/olcPixelGameEngine.h +++ b/Videos/CarCrimeCity/Part1/olcPixelGameEngine.h @@ -160,7 +160,7 @@ // called once per frame, draws random coloured pixels for (int x = 0; x < ScreenWidth(); x++) for (int y = 0; y < ScreenHeight(); y++) - Draw(x, y, olc::Pixel(rand() % 255, rand() % 255, rand()% 255)); + Draw(x, y, olc::Pixel(rand() % 256, rand() % 256, rand() % 256)); return true; } }; diff --git a/Videos/CarCrimeCity/Part2/olcPixelGameEngine.h b/Videos/CarCrimeCity/Part2/olcPixelGameEngine.h index 4d13e6d..99a0671 100644 --- a/Videos/CarCrimeCity/Part2/olcPixelGameEngine.h +++ b/Videos/CarCrimeCity/Part2/olcPixelGameEngine.h @@ -160,7 +160,7 @@ // called once per frame, draws random coloured pixels for (int x = 0; x < ScreenWidth(); x++) for (int y = 0; y < ScreenHeight(); y++) - Draw(x, y, olc::Pixel(rand() % 255, rand() % 255, rand()% 255)); + Draw(x, y, olc::Pixel(rand() % 256, rand() % 256, rand() % 256)); return true; } }; diff --git a/Videos/SavingSedit/olcPixelGameEngine.h b/Videos/SavingSedit/olcPixelGameEngine.h index a6f36ed..404df17 100644 --- a/Videos/SavingSedit/olcPixelGameEngine.h +++ b/Videos/SavingSedit/olcPixelGameEngine.h @@ -160,7 +160,7 @@ // called once per frame, draws random coloured pixels for (int x = 0; x < ScreenWidth(); x++) for (int y = 0; y < ScreenHeight(); y++) - Draw(x, y, olc::Pixel(rand() % 255, rand() % 255, rand()% 255)); + Draw(x, y, olc::Pixel(rand() % 256, rand() % 256, rand() % 256)); return true; } }; diff --git a/olcExampleProgram.cpp b/olcExampleProgram.cpp index c9f3588..e31fd2b 100644 --- a/olcExampleProgram.cpp +++ b/olcExampleProgram.cpp @@ -21,7 +21,7 @@ public: // called once per frame for (int x = 0; x < ScreenWidth(); x++) for (int y = 0; y < ScreenHeight(); y++) - Draw(x, y, olc::Pixel(rand() % 255, rand() % 255, rand()% 255)); + Draw(x, y, olc::Pixel(rand() % 256, rand() % 256, rand() % 256)); return true; } };