Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Images working

  • Loading branch information...
commit 0af16cc947e30f753947fe2d17407496d0ca68a7 1 parent 4d2416d
Sébastien Bourdeauducq authored November 23, 2011
18  src/renderer/compiler.c
@@ -228,7 +228,11 @@ static void load_defaults(struct compiler_sc *sc)
228 228
 	
229 229
 	sc->p->pfv_initial[pfv_video_echo_zoom] = 1.0;
230 230
 	
  231
+	sc->p->pfv_initial[pfv_image1_x] = 0.5;
  232
+	sc->p->pfv_initial[pfv_image1_y] = 0.5;
231 233
 	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;
232 236
 	sc->p->pfv_initial[pfv_image2_zoom] = 1.0;
233 237
 }
234 238
 
@@ -586,13 +590,19 @@ static bool process_top_assign(struct compiler_sc *sc, char *left, char *right)
586 590
 			comp_report(sc, "warning l.%d: ignoring image with out of bounds number %d", sc->linenr, image_n);
587 591
 			return true;
588 592
 		}
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
+		}
593 602
 		pixbuf_dec_ref(sc->p->images[image_n]);
594 603
 		sc->p->images[image_n] = pixbuf_get(totalname);
595 604
 		free(totalname);
  605
+		return true;
596 606
 	}
597 607
 
598 608
 	pfv = pfv_from_name(sc, left);
4  src/renderer/raster.c
@@ -508,7 +508,7 @@ static void images(unsigned short *tex_backbuffer, struct frame_descriptor *frd,
508 508
 			
509 509
 			ftexsize = (float)renderer_texsize;
510 510
 			dx = ftexsize*frd->image_x[i];
511  
-			dx = ftexsize*frd->image_y[i];
  511
+			dy = ftexsize*frd->image_y[i];
512 512
 			sx = ((float)frd->images[i]->width)*frd->image_zoom[i];
513 513
 			sy = ((float)frd->images[i]->height)*frd->image_zoom[i];
514 514
 			
@@ -521,7 +521,7 @@ static void images(unsigned short *tex_backbuffer, struct frame_descriptor *frd,
521 521
 			scale_vertices[TMU_MESH_MAXSIZE+1].x = frd->images[i]->width << TMU_FIXEDPOINT_SHIFT;
522 522
 			scale_vertices[TMU_MESH_MAXSIZE+1].y = frd->images[i]->height << TMU_FIXEDPOINT_SHIFT;
523 523
 			
524  
-			td.flags = 0;
  524
+			td.flags = TMU_FLAG_ADDITIVE;
525 525
 			td.hmeshlast = 1;
526 526
 			td.vmeshlast = 1;
527 527
 			td.brightness = TMU_BRIGHTNESS_MAX;

0 notes on commit 0af16cc

Please sign in to comment.
Something went wrong with that request. Please try again.