Skip to content

Commit

Permalink
GRAPHICS: Remove obsolete and unused primitives
Browse files Browse the repository at this point in the history
  • Loading branch information
lephilousophe committed Jan 12, 2025
1 parent 8ff60e2 commit cac81af
Showing 2 changed files with 0 additions and 108 deletions.
79 changes: 0 additions & 79 deletions graphics/primitives.cpp
Original file line number Diff line number Diff line change
@@ -451,83 +451,4 @@ void Primitives::drawEllipse(int x0, int y0, int x1, int y1, uint32 color, bool
}
}

class DeprecatedPrimitives final : public Primitives {
public:
constexpr DeprecatedPrimitives(void (*plotProc)(int, int, int, void *)) : _plotProc(plotProc) {}

void drawPoint(int x, int y, uint32 color, void *data) override {
_plotProc(x, y, color, data);
}

private:
void (*_plotProc)(int, int, int, void *);
};

void drawLine(int x0, int y0, int x1, int y1, uint32 color, void (*plotProc)(int, int, int, void *), void *data) {
DeprecatedPrimitives primitives(plotProc);
primitives.drawLine(x0, y0, x1, y1, color, data);
}

void drawHLine(int x1, int x2, int y, uint32 color, void (*plotProc)(int, int, int, void *), void *data) {
DeprecatedPrimitives primitives(plotProc);
primitives.drawHLine(x1, x2, y, color, data);
}

void drawVLine(int x, int y1, int y2, uint32 color, void (*plotProc)(int, int, int, void *), void *data) {
DeprecatedPrimitives primitives(plotProc);
primitives.drawVLine(x, y1, y2, color, data);
}

void drawThickLine(int x0, int y0, int x1, int y1, int penX, int penY, uint32 color, void (*plotProc)(int, int, int, void *), void *data) {
DeprecatedPrimitives primitives(plotProc);
primitives.drawThickLine(x0, y0, x1, y1, penX, penY, color, data);
}

void drawThickLine2(int x1, int y1, int x2, int y2, int thick, uint32 color,
void (*plotProc)(int, int, int, void *), void *data) {
DeprecatedPrimitives primitives(plotProc);
primitives.drawThickLine2(x1, y1, x2, y2, thick, color, data);
}

void drawFilledRect(const Common::Rect &rect, uint32 color, void (*plotProc)(int, int, int, void *), void *data) {
DeprecatedPrimitives primitives(plotProc);
primitives.drawFilledRect(rect, color, data);
}

void drawFilledRect1(const Common::Rect &rect, uint32 color, void (*plotProc)(int, int, int, void *), void *data) {
DeprecatedPrimitives primitives(plotProc);
primitives.drawFilledRect1(rect, color, data);
}

void drawRect(const Common::Rect &rect, uint32 color, void (*plotProc)(int, int, int, void *), void *data) {
DeprecatedPrimitives primitives(plotProc);
primitives.drawRect(rect, color, data);
}

void drawRect1(const Common::Rect &rect, uint32 color, void (*plotProc)(int, int, int, void *), void *data) {
DeprecatedPrimitives primitives(plotProc);
primitives.drawRect1(rect, color, data);
}

void drawRoundRect(const Common::Rect &rect, int arc, uint32 color, bool filled, void (*plotProc)(int, int, int, void *), void *data) {
DeprecatedPrimitives primitives(plotProc);
primitives.drawRoundRect(rect, arc, color, filled, data);
}

void drawRoundRect1(const Common::Rect &rect, int arc, uint32 color, bool filled, void (*plotProc)(int, int, int, void *), void *data) {
DeprecatedPrimitives primitives(plotProc);
primitives.drawRoundRect1(rect, arc, color, filled, data);
}

void drawPolygonScan(const int *polyX, const int *polyY, int npoints, const Common::Rect &bbox, uint32 color,
void (*plotProc)(int, int, int, void *), void *data) {
DeprecatedPrimitives primitives(plotProc);
primitives.drawPolygonScan(polyX, polyY, npoints, bbox, color, data);
}

void drawEllipse(int x0, int y0, int x1, int y1, uint32 color, bool filled, void (*plotProc)(int, int, int, void *), void *data) {
DeprecatedPrimitives primitives(plotProc);
primitives.drawEllipse(x0, y0, x1, y1, color, filled, data);
}

} // End of namespace Graphics
29 changes: 0 additions & 29 deletions graphics/primitives.h
Original file line number Diff line number Diff line change
@@ -47,35 +47,6 @@ class Primitives {
virtual void drawEllipse(int x0, int y0, int x1, int y1, uint32 color, bool filled, void *data);
};

WARN_DEPRECATED("Use a subclass of Graphics::Primitives")
void drawLine(int x0, int y0, int x1, int y1, uint32 color, void (*plotProc)(int, int, int, void *), void *data);
WARN_DEPRECATED("Use a subclass of Graphics::Primitives")
void drawHLine(int x1, int x2, int y, uint32 color, void (*plotProc)(int, int, int, void *), void *data);
WARN_DEPRECATED("Use a subclass of Graphics::Primitives")
void drawVLine(int x, int y1, int y2, uint32 color, void (*plotProc)(int, int, int, void *), void *data);
WARN_DEPRECATED("Use a subclass of Graphics::Primitives")
void drawThickLine(int x0, int y0, int x1, int y1, int penX, int penY, uint32 color, void (*plotProc)(int, int, int, void *), void *data);
WARN_DEPRECATED("Use a subclass of Graphics::Primitives")
void drawThickLine2(int x1, int y1, int x2, int y2, int thick, uint32 color,
void (*plotProc)(int, int, int, void *), void *data);
WARN_DEPRECATED("Use a subclass of Graphics::Primitives")
void drawFilledRect(const Common::Rect &rect, uint32 color, void (*plotProc)(int, int, int, void *), void *data);
WARN_DEPRECATED("Use a subclass of Graphics::Primitives")
void drawFilledRect1(const Common::Rect &rect, uint32 color, void (*plotProc)(int, int, int, void *), void *data);
WARN_DEPRECATED("Use a subclass of Graphics::Primitives")
void drawRect(const Common::Rect &rect, uint32 color, void (*plotProc)(int, int, int, void *), void *data);
WARN_DEPRECATED("Use a subclass of Graphics::Primitives")
void drawRect1(const Common::Rect &rect, uint32 color, void (*plotProc)(int, int, int, void *), void *data);
WARN_DEPRECATED("Use a subclass of Graphics::Primitives")
void drawRoundRect(const Common::Rect &rect, int arc, uint32 color, bool filled, void (*plotProc)(int, int, int, void *), void *data);
WARN_DEPRECATED("Use a subclass of Graphics::Primitives")
void drawRoundRect1(const Common::Rect &rect, int arc, uint32 color, bool filled, void (*plotProc)(int, int, int, void *), void *data);
WARN_DEPRECATED("Use a subclass of Graphics::Primitives")
void drawPolygonScan(const int *polyX, const int *polyY, int npoints, const Common::Rect &bbox, uint32 color,
void (*plotProc)(int, int, int, void *), void *data);
WARN_DEPRECATED("Use a subclass of Graphics::Primitives")
void drawEllipse(int x0, int y0, int x1, int y1, uint32 color, bool filled, void (*plotProc)(int, int, int, void *), void *data);

} // End of namespace Graphics

#endif

0 comments on commit cac81af

Please sign in to comment.