This got broken in 586168c91f314a8bf01f3efaac5c45d80eb43d27, which changed the code to compare a GX mode (an 8-bit integer) with GL_LINE_LOOP (which is a GLenum, 16-bit wide).
We fix this by refactoring the draw_mode() function to return a small struct containing both the GX mode and a flag to indicate if looping is needed.
This got broken in 586168c91f314a8bf01f3efaac5c45d80eb43d27, which changed the code to compare a GX mode (an 8-bit integer) with GL_LINE_LOOP (which is a GLenum, 16-bit wide).
We fix this by refactoring the draw_mode() function to return a small struct containing both the GX mode and a flag to indicate if looping is needed.