@@ -731,22 +731,27 @@ void ImDrawList::PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, c
731
731
#define IM_POLYLINE_IDX_16_BIT 0
732
732
#else
733
733
#define IM_POLYLINE_IDX_16_BIT 1
734
- # endif
735
-
736
- // Macros that declare, load and save write pointers as local variables
737
- #define IM_POLYLINE_PRIM_MAKE_LOCAL () ImDrawVert* vtx_write = this ->_VtxWritePtr; ImDrawIdx* idx_write = this ->_IdxWritePtr; unsigned int idx_base = this ->_VtxCurrentIdx
738
- #define IM_POLYLINE_PRIM_LOAD_LOCAL () vtx_write = this ->_VtxWritePtr; idx_write = this ->_IdxWritePtr; idx_base = this ->_VtxCurrentIdx
739
- #define IM_POLYLINE_PRIM_SAVE_LOCAL () this ->_VtxWritePtr = vtx_write; this ->_IdxWritePtr = idx_write; this ->_VtxCurrentIdx = idx_base
734
+ #endif
740
735
741
736
// Macros that commit, split and handle vertex offset overflow
742
- #define IM_POLYLINE_PRIM_RESERVE (IDX_COUNT, VTX_COUNT ) this ->PrimReserve ((IDX_COUNT) + IM_POLYLINE_PRIM_EXTRA_IDX_COUNT, VTX_COUNT); IM_POLYLINE_PRIM_MAKE_LOCAL()
737
+ #define IM_POLYLINE_PRIM_RESERVE (IDX_COUNT, VTX_COUNT ) \
738
+ this ->PrimReserve ((IDX_COUNT) + IM_POLYLINE_PRIM_EXTRA_IDX_COUNT, VTX_COUNT); \
739
+ ImDrawVert* vtx_write = this ->_VtxWritePtr; \
740
+ ImDrawIdx* idx_write = this ->_IdxWritePtr; \
741
+ unsigned int idx_base = this ->_VtxCurrentIdx;
742
+
743
743
#define IM_POLYLINE_PRIM_COMMIT () \
744
- IM_POLYLINE_PRIM_SAVE_LOCAL (); \
744
+ this ->_VtxWritePtr = vtx_write; this ->_IdxWritePtr = idx_write; this ->_VtxCurrentIdx = idx_base; \
745
745
const int unused_vtx_count = (int )((this ->VtxBuffer.Data + this ->VtxBuffer.Size ) - this ->_VtxWritePtr); \
746
746
const int unused_idx_count = (int )((this ->IdxBuffer.Data + this ->IdxBuffer.Size ) - this ->_IdxWritePtr); \
747
747
this ->PrimUnreserve (unused_idx_count, unused_vtx_count)
748
748
749
- #define IM_POLYLINE_PRIM_SPLT () IM_POLYLINE_PRIM_COMMIT(); this ->PrimReserve (unused_idx_count, unused_vtx_count); IM_POLYLINE_PRIM_LOAD_LOCAL()
749
+ #define IM_POLYLINE_PRIM_SPLT () \
750
+ IM_POLYLINE_PRIM_COMMIT (); \
751
+ this ->PrimReserve (unused_idx_count, unused_vtx_count); \
752
+ vtx_write = this ->_VtxWritePtr; \
753
+ idx_write = this ->_IdxWritePtr; \
754
+ idx_base = this ->_VtxCurrentIdx;
750
755
751
756
#define IM_POLYLINE_VTX_COMMIT (N ) \
752
757
{ \
0 commit comments