All pastes #414543 Raw Edit

Mine

public text v1 · immutable
#414543 ·published 2007-03-29 02:30 UTC
rendered paste body
	for(i=0;i<3;i++) {
		fscanf(fh, " %d %d ", &width, &height);
		tilearray_init(&map->layers[i]);
		tilearray_expand_width(&map->layers[i], width);
		tilearray_expand_height(&map->layers[i], height);
		for(j=0;j<map->layers[i].height;j++) {
			for(k=0;k<map->layers[i].width;k++) {
				int a = fgetc(fh);
				int b = fgetc(fh);
				int c = fgetc(fh);
				int d = fgetc(fh);
				int tile = a | (b<<8) | (c<<16) | (d<<24);
				map->layers[i].buffer[j][k] = tile;
			}
		}		
	}