projects
/
fbgfx
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
unknown changes
[fbgfx]
/
src
/
tunnel.c
diff --git
a/src/tunnel.c
b/src/tunnel.c
index
c331f2d
..
221fadc
100644
(file)
--- a/
src/tunnel.c
+++ b/
src/tunnel.c
@@
-13,6
+13,15
@@
#define TEX_USCALE 4
#define TEX_VSCALE 2
#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);
static int init(void);
static void destroy(void);
static void start(long trans_time);
@@
-140,6
+149,13
@@
static int init(void)
return -1;
}
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;
}
return 0;
}
@@
-152,26
+168,22
@@
static void destroy(void)
static void start(long trans_time)
{
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)
{
}
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)
{
static void work_func(void *cls)
{
@@
-204,8
+216,6
@@
static void draw(void)
yoffs = (int)(sin(t * 4.0) * pan_height / 2) + pan_height / 2;
for(i=0; i<NUM_WORK_ITEMS; i++) {
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;
work[i].num_lines = draw_lines;
work[i].tm = time_msec;
work[i].xoffs = xoffs;
@@
-259,7
+269,7
@@
static void draw_tunnel_range16(void *pix, int xoffs, int yoffs, int starty, int
tunnel_color(&r, &g, &b, toffs, tmap[j], fog[j]);
col = PACK_RGB16(r, g, b);
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;
}
tmap += vxsz;
fog += vxsz;