Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lekernel committed Feb 17, 2010
1 parent b13781f commit 56fedf5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
7 changes: 5 additions & 2 deletions software/demo/apipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,13 @@ static void pfv_callback(struct pfpu_td *td)
{
struct rpipe_frame *rpipe_frame;
int brightness256, brightness64, frame_mod;
float decay;

rpipe_frame = (struct rpipe_frame *)td->user;

brightness256 = 256.0*eval_read_pfv(eval, pfv_decay) + 0.5;
brightness64 = brightness256 >> 2;
decay = eval_read_pfv(eval, pfv_decay);
brightness256 = 255.0*decay+3.5;
brightness64 = (brightness256 >> 2)-1;
brightness256 &= 3;
frame_mod = rpipe_frame->framenr & 3;
if((brightness256 == 1) && (frame_mod == 0))
Expand All @@ -156,6 +158,7 @@ static void pfv_callback(struct pfpu_td *td)
brightness64++;
if((brightness256 == 3) && (frame_mod != 3))
brightness64++;
if(brightness64 < 0) brightness64 = 0;
if(brightness64 > 63) brightness64 = 63;
rpipe_frame->brightness = brightness64;

Expand Down
2 changes: 2 additions & 0 deletions software/demo/eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ static int generate_perframe(struct eval_state *sc, struct preset *ast)
scheduler_dont_touch(&scheduler, compiler.terminals);
scheduler_schedule(&scheduler, compiler.prog, compiler.prog_length);
/* patch the program to make a dummy DMA at the end (otherwise PFPU never finishes) */
scheduler.last_exit++;
if(scheduler.last_exit == PFPU_PROGSIZE) return 0;
scheduler.prog[scheduler.last_exit].i.opcode = PFPU_OPCODE_VECTOUT;

#ifdef EVAL_DEBUG
Expand Down
4 changes: 4 additions & 0 deletions software/demo/rpipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ static void rpipe_draw_motion_vectors()
int nx, ny;
int l;

if(bh_frame->mv_a == 0.0) return;
if(bh_frame->mv_x == 0.0) return;
if(bh_frame->mv_y == 0.0) return;

l = bh_frame->mv_l;
if(l > 10) l = 10;

Expand Down
2 changes: 2 additions & 0 deletions software/demo/wave.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ void wave_draw(unsigned short *framebuffer, unsigned int hres, unsigned int vres
float wave_o;
int i;

if(nvertices == 0) return;

line_init_context(&ctx, framebuffer, hres, vres);

//TODO: implement modulate_opacity_by_volume
Expand Down

0 comments on commit 56fedf5

Please sign in to comment.