From: Mikko Rasa Date: Thu, 30 Aug 2012 19:48:48 +0000 (+0300) Subject: Fix logic with appending Batches X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=7398ee7ebbd8b7e56c721a85cbe721b79758d09a Fix logic with appending Batches Allow combining Batches of any primitive type with NV_primitive_restart, and don't use it if not necessary. --- 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)