From a4e9fdd9fdf40eb1e022b40683ba40a69608ecc0 Mon Sep 17 00:00:00 2001 From: n00b Date: Fri, 20 Dec 2024 12:01:05 -0500 Subject: [PATCH] Sorted points in Triangle() --- rcbasic_runtime/main.cpp | 4 ++-- rcbasic_runtime/rc_gfx.h | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rcbasic_runtime/main.cpp b/rcbasic_runtime/main.cpp index 5ec8d0a..540d58a 100755 --- a/rcbasic_runtime/main.cpp +++ b/rcbasic_runtime/main.cpp @@ -4447,8 +4447,8 @@ int main(int argc, char * argv[]) std::cin >> debug_opt; if(debug_opt.compare("a")==0) { - //rc_intern_dirChange("/home/n00b/Music/rcbasic_v400_linux64/examples/tile_demo"); - rc_intern_dirChange(""); + rc_intern_dirChange("/home/n00b/Downloads/Tile Scrolling"); + //rc_intern_dirChange(""); rc_filename = "main.cbc"; } else diff --git a/rcbasic_runtime/rc_gfx.h b/rcbasic_runtime/rc_gfx.h index 9b5ad2f..f6b061f 100644 --- a/rcbasic_runtime/rc_gfx.h +++ b/rcbasic_runtime/rc_gfx.h @@ -1666,7 +1666,7 @@ void rc_drawTriangle3D(double x1, double y1, double z1, double x2, double y2, do void rc_drawTriangle(double x1, double y1, double x2, double y2, double x3, double y3) { - irr::core::array v; + irr::core::array v; v.push_back(video::S3DVertex(x1, y1, 0.f, 0.f, 1.f, 0.f, rc_active_color, 0.5f, 0.5f)); v.push_back(video::S3DVertex(x2, y2, 0.f, 0.f, 1.f, 0.f, rc_active_color, 0.5f, 0.5f)); v.push_back(video::S3DVertex(x3, y3, 0.f, 0.f, 1.f, 0.f, rc_active_color, 0.5f, 0.5f)); @@ -1676,6 +1676,8 @@ void rc_drawTriangle(double x1, double y1, double x2, double y2, double x3, doub i.push_back(1); i.push_back(2); + v.sort(); + VideoDriver->draw2DVertexPrimitiveList(v.pointer(), 3, i.pointer(), 1); }