From 60ea1ae7257d60d3ee05f1b9d412a1bd441db7cb Mon Sep 17 00:00:00 2001 From: jonas Date: Mon, 14 Jan 2019 17:30:06 +0100 Subject: RTFM!! Error resulted in illegal coordiante pair for drawLine (x2 > x1) --- cRender.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cRender.cpp') diff --git a/cRender.cpp b/cRender.cpp index a01418e..41908e1 100644 --- a/cRender.cpp +++ b/cRender.cpp @@ -88,6 +88,12 @@ int cRender::drawPoint(char _c, sPos _pos, bool _overrideCollision, WORD _color) int cRender::drawLine(char _c, sPos _pos1, sPos _pos2, bool _overrideCollision, WORD _color) { + if(_pos1.x > _pos2.x) + { + //Shit WILL go wrong + return drawLine(_c, _pos2, _pos1, _overrideCollision, _color); + } + if (_pos1.x == _pos2.x) { //Horizontal line for (int i = _pos1.y; i <= _pos2.y; i++) { -- cgit v1.2.3