Skip to content

Commit

Permalink
Images working
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Bourdeauducq committed Nov 23, 2011
1 parent 4d2416d commit 0af16cc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
18 changes: 14 additions & 4 deletions src/renderer/compiler.c
Expand Up @@ -228,7 +228,11 @@ static void load_defaults(struct compiler_sc *sc)

sc->p->pfv_initial[pfv_video_echo_zoom] = 1.0;

sc->p->pfv_initial[pfv_image1_x] = 0.5;
sc->p->pfv_initial[pfv_image1_y] = 0.5;
sc->p->pfv_initial[pfv_image1_zoom] = 1.0;
sc->p->pfv_initial[pfv_image2_x] = 0.5;
sc->p->pfv_initial[pfv_image2_y] = 0.5;
sc->p->pfv_initial[pfv_image2_zoom] = 1.0;
}

Expand Down Expand Up @@ -586,13 +590,19 @@ static bool process_top_assign(struct compiler_sc *sc, char *left, char *right)
comp_report(sc, "warning l.%d: ignoring image with out of bounds number %d", sc->linenr, image_n);
return true;
}
totalname = malloc(strlen(sc->basedir) + strlen(right) + 0);
if(totalname == NULL) return true;
strcpy(totalname, sc->basedir);
strcat(totalname, right);
image_n--;
if(right[0] == '/')
totalname = strdup(right);
else {
totalname = malloc(strlen(sc->basedir) + strlen(right) + 0);
if(totalname == NULL) return true;
strcpy(totalname, sc->basedir);
strcat(totalname, right);
}
pixbuf_dec_ref(sc->p->images[image_n]);
sc->p->images[image_n] = pixbuf_get(totalname);
free(totalname);
return true;
}

pfv = pfv_from_name(sc, left);
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/raster.c
Expand Up @@ -508,7 +508,7 @@ static void images(unsigned short *tex_backbuffer, struct frame_descriptor *frd,

ftexsize = (float)renderer_texsize;
dx = ftexsize*frd->image_x[i];
dx = ftexsize*frd->image_y[i];
dy = ftexsize*frd->image_y[i];
sx = ((float)frd->images[i]->width)*frd->image_zoom[i];
sy = ((float)frd->images[i]->height)*frd->image_zoom[i];

Expand All @@ -521,7 +521,7 @@ static void images(unsigned short *tex_backbuffer, struct frame_descriptor *frd,
scale_vertices[TMU_MESH_MAXSIZE+1].x = frd->images[i]->width << TMU_FIXEDPOINT_SHIFT;
scale_vertices[TMU_MESH_MAXSIZE+1].y = frd->images[i]->height << TMU_FIXEDPOINT_SHIFT;

td.flags = 0;
td.flags = TMU_FLAG_ADDITIVE;
td.hmeshlast = 1;
td.vmeshlast = 1;
td.brightness = TMU_BRIGHTNESS_MAX;
Expand Down

0 comments on commit 0af16cc

Please sign in to comment.