diff options
author | jonas <himself@jonasgunz.de> | 2019-01-14 17:30:06 +0100 |
---|---|---|
committer | jonas <himself@jonasgunz.de> | 2019-01-14 17:30:06 +0100 |
commit | 60ea1ae7257d60d3ee05f1b9d412a1bd441db7cb (patch) | |
tree | 819063addd6b1abf972adea2e49a83299280c9b2 /cRender.cpp | |
parent | 5d0b6dd79722707afb15642cc8523b36a6391e0d (diff) | |
download | termgl-60ea1ae7257d60d3ee05f1b9d412a1bd441db7cb.tar.gz |
RTFM!! Error resulted in illegal coordiante pair for drawLine (x2 > x1)
Diffstat (limited to 'cRender.cpp')
-rw-r--r-- | cRender.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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++) { |