Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Images working

  • Loading branch information...
commit 0af16cc947e30f753947fe2d17407496d0ca68a7 1 parent 4d2416d
@sbourdeauducq sbourdeauducq authored
Showing with 16 additions and 6 deletions.
  1. +14 −4 src/renderer/compiler.c
  2. +2 −2 src/renderer/raster.c
View
18 src/renderer/compiler.c
@@ -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;
}
@@ -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);
View
4 src/renderer/raster.c
@@ -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];
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.