22#include " ../Collider.hpp"
33#include " ../Texture.hpp"
44#include " Utils.hpp"
5- #include < vector>
65#include < memory>
6+ #include < vector>
77
88struct DrawOptions {
99 int screen_width;
@@ -75,10 +75,12 @@ class Shape {
7575
7676 // Protected helper methods
7777 std::pair<int , int > getTransformedPosition (int inputX, int inputY);
78- void bresenhamLine (Pixels &points, int x0, int y0, int x1, int y1);
79- void wuLine (Pixels &points, int x0, int y0, int x1, int y1);
80- void addPixel (Pixels &points, int x, int y, float alpha);
81- void getInsidePoints (Pixels &points,
78+
79+ void setPixelSafe (Display &displayGrid, int x, int y, const Color &c);
80+ void bresenhamLine (Display &points, int x0, int y0, int x1, int y1);
81+ void wuLine (Display &points, int x0, int y0, int x1, int y1);
82+ void addPixel (Display &points, int x, int y, float alpha);
83+ void getInsidePoints (Display &points,
8284 const std::vector<std::pair<int , int >> &vertices);
8385 void getUVAt (int x, int y, float &outU, float &outV);
8486
@@ -91,12 +93,12 @@ class Shape {
9193 std::pair<int , int > transformPoint (int x, int y, const Matrix2D &m);
9294
9395 // Pure virtual methods
94- virtual void drawAntiAliased (Pixels &pixels) = 0;
95- virtual void drawAliased (Pixels &pixels) = 0;
96+ virtual void drawAntiAliased (Display &pixels) = 0;
97+ virtual void drawAliased (Display &pixels) = 0;
9698 virtual Collider *defaultCollider () = 0;
9799
98100 // Drawing
99- void draw (Pixels &pixels, const DrawOptions &options);
101+ void draw (Display &pixels, const DrawOptions &options);
100102
101103 // Position and transformation methods
102104 void setPosition (int x, int y);
0 commit comments