From 7398ee7ebbd8b7e56c721a85cbe721b79758d09a Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 30 Aug 2012 22:48:48 +0300 Subject: [PATCH] Fix logic with appending Batches Allow combining Batches of any primitive type with NV_primitive_restart, and don't use it if not necessary. --- source/batch.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/source/batch.cpp b/source/batch.cpp index 785fca82..d4b6497f 100644 --- a/source/batch.cpp +++ b/source/batch.cpp @@ -167,17 +167,15 @@ void Batch::append(const Batch &other) { if(other.prim_type!=prim_type) throw invalid_argument("Batch::append"); - if(prim_type==LINE_STRIP || prim_type==LINE_LOOP) - throw incompatible_data("Batch::append"); - else if(prim_type==POLYGON) - throw incompatible_data("Batch::append"); - else if(prim_type==TRIANGLE_FAN) + if(prim_type==LINE_STRIP || prim_type==LINE_LOOP || prim_type==TRIANGLE_FAN || prim_type==POLYGON) static Require _req(NV_primitive_restart); if(other.data.empty()) return; - if(NV_primitive_restart) + if(prim_type==POINTS || prim_type==LINES || prim_type==TRIANGLES || prim_type==QUADS) + ; + else if(NV_primitive_restart) { restart = true; if(data_type==UNSIGNED_SHORT) -- 2.45.2