#define TEX_USCALE 4
#define TEX_VSCALE 2
+#define NUM_WORK_ITEMS 8
+
+static struct work {
+ void *pixels;
+ int starty, num_lines;
+ long tm;
+ int xoffs, yoffs;
+} work[NUM_WORK_ITEMS];
+
static int init(void);
static void destroy(void);
static void start(long trans_time);
return -1;
}
+ /* initialize the constant part of all work items */
+ for(i=0; i<NUM_WORK_ITEMS; i++) {
+ int num_lines = ysz / NUM_WORK_ITEMS;
+ work[i].pixels = fb_pixels;
+ work[i].starty = i * num_lines;
+ }
+
return 0;
}
static void start(long trans_time)
{
- trans_start = time_msec;
- trans_dur = trans_time;
- trans_dir = 1;
+ if(trans_time) {
+ trans_start = time_msec;
+ trans_dur = trans_time;
+ trans_dir = 1;
+ }
}
static void stop(long trans_time)
{
- trans_start = time_msec;
- trans_dur = trans_time;
- trans_dir = -1;
+ if(trans_time) {
+ trans_start = time_msec;
+ trans_dur = trans_time;
+ trans_dir = -1;
+ }
}
-#define NUM_WORK_ITEMS 32
-
-static struct work {
- void *pixels;
- int starty, num_lines;
- long tm;
- int xoffs, yoffs;
-} work[NUM_WORK_ITEMS];
static void work_func(void *cls)
{
yoffs = (int)(sin(t * 4.0) * pan_height / 2) + pan_height / 2;
for(i=0; i<NUM_WORK_ITEMS; i++) {
- work[i].pixels = fb_pixels;
- work[i].starty = i * num_lines;
work[i].num_lines = draw_lines;
work[i].tm = time_msec;
work[i].xoffs = xoffs;
tunnel_color(&r, &g, &b, toffs, tmap[j], fog[j]);
col = PACK_RGB16(r, g, b);
- *pixels++ = col;
+ *pixels++ = (col << 16) | col;
}
tmap += vxsz;
fog += vxsz;