+ int i, num_lines = vysz / NUM_WORK_ITEMS;
+ for(i=0; i<NUM_WORK_ITEMS; i++) {
+ work[i].pixels = pixels;
+ work[i].starty = i * num_lines;
+ work[i].num_lines = num_lines;
+
+ tpool_enqueue(tpool, work + i, work_func, 0);
+ }
+ tpool_wait(tpool);
+}
+
+#define PACK_RGB16(r, g, b) \
+ (((((r) >> 3) & 0x1f) << 11) | ((((g) >> 2) & 0x3f) << 5) | ((b) & 0x1f))
+
+static void draw_tunnel_range(unsigned short *pixels, int starty, int num_lines)
+{
+ int i, j, k, r, g, b;
+ unsigned int *tmap = tunnel_map + starty * vxsz;
+ unsigned char *fog = tunnel_fog + starty * vxsz;
+
+ long toffs = time_msec / 4;
+ pixels += starty * xsz * VSCALE;