Skip to content

Commit 0af16cc

Browse files
author
Sebastien Bourdeauducq
committedNov 23, 2011
Images working
1 parent 4d2416d commit 0af16cc

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed
 

‎src/renderer/compiler.c

+14-4
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,11 @@ static void load_defaults(struct compiler_sc *sc)
228228

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

231+
sc->p->pfv_initial[pfv_image1_x] = 0.5;
232+
sc->p->pfv_initial[pfv_image1_y] = 0.5;
231233
sc->p->pfv_initial[pfv_image1_zoom] = 1.0;
234+
sc->p->pfv_initial[pfv_image2_x] = 0.5;
235+
sc->p->pfv_initial[pfv_image2_y] = 0.5;
232236
sc->p->pfv_initial[pfv_image2_zoom] = 1.0;
233237
}
234238

@@ -586,13 +590,19 @@ static bool process_top_assign(struct compiler_sc *sc, char *left, char *right)
586590
comp_report(sc, "warning l.%d: ignoring image with out of bounds number %d", sc->linenr, image_n);
587591
return true;
588592
}
589-
totalname = malloc(strlen(sc->basedir) + strlen(right) + 0);
590-
if(totalname == NULL) return true;
591-
strcpy(totalname, sc->basedir);
592-
strcat(totalname, right);
593+
image_n--;
594+
if(right[0] == '/')
595+
totalname = strdup(right);
596+
else {
597+
totalname = malloc(strlen(sc->basedir) + strlen(right) + 0);
598+
if(totalname == NULL) return true;
599+
strcpy(totalname, sc->basedir);
600+
strcat(totalname, right);
601+
}
593602
pixbuf_dec_ref(sc->p->images[image_n]);
594603
sc->p->images[image_n] = pixbuf_get(totalname);
595604
free(totalname);
605+
return true;
596606
}
597607

598608
pfv = pfv_from_name(sc, left);

‎src/renderer/raster.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ static void images(unsigned short *tex_backbuffer, struct frame_descriptor *frd,
508508

509509
ftexsize = (float)renderer_texsize;
510510
dx = ftexsize*frd->image_x[i];
511-
dx = ftexsize*frd->image_y[i];
511+
dy = ftexsize*frd->image_y[i];
512512
sx = ((float)frd->images[i]->width)*frd->image_zoom[i];
513513
sy = ((float)frd->images[i]->height)*frd->image_zoom[i];
514514

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

524-
td.flags = 0;
524+
td.flags = TMU_FLAG_ADDITIVE;
525525
td.hmeshlast = 1;
526526
td.vmeshlast = 1;
527527
td.brightness = TMU_BRIGHTNESS_MAX;

0 commit comments

Comments
 (0)