コード例 #1
0
ファイル: example.c プロジェクト: Crapoto/tmx
void dump_layer(tmx_layer l, unsigned int tc) {
	unsigned int i;
	printf("layer={");
	if (!l) {
		fputs("\n(NULL)", stdout);
	} else {
		printf("\n\tname='%s'", l->name);
		printf("\n\tvisible='%d'", l->visible);
		printf("\n\topacity='%f'", l->opacity);
		if (l->type == L_LAYER && l->content.gids) {
			printf("\n\ttype=Layer\n\ttiles=");
			for (i=0; i<tc; i++)
				printf("%d,", l->content.gids[i] & TMX_FLIP_BITS_REMOVAL);
		} else if (l->type == L_OBJGR) {
			printf("\n\ttype=ObjectGroup");
		}
	}
	puts("\n}");

	if (l) {
		if (l->type == L_OBJGR && l->content.head) dump_objects(l->content.head);
		if (l->properties) dump_prop(l->properties);
		if (l->next) dump_layer(l->next, tc);
	}
}
コード例 #2
0
ファイル: dumper.c プロジェクト: jabelardo/tmx
void dump_layer(tmx_layer *l, unsigned int tc) {
	unsigned int i;
	printf("\nlayer={");
	if (!l) {
		printf(" (NULL) }");
	} else {
		printf("\n\t" "name='%s'", l->name);
		printf("\n\t" "visible=%s", str_bool(l->visible));
		printf("\n\t" "opacity='%f'", l->opacity);
		if (l->type == L_LAYER && l->content.gids) {
			printf("\n\t" "type=Layer" "\n\t" "tiles=");
			for (i=0; i<tc; i++) {
				printf("%d,", l->content.gids[i] & TMX_FLIP_BITS_REMOVAL);
			}
		} else if (l->type == L_OBJGR) {
			printf("\n\t" "color=#%.6X", l->content.objgr->color);
			printf("\n\t" "draworder="); print_draworder(l->content.objgr->draworder);
			printf("\n\t" "type=ObjectGroup");
			dump_objects(l->content.objgr->head, 1);
		} else if (l->type == L_IMAGE) {
			printf("\n\t" "x_offset=%d", l->x_offset);
			printf("\n\t" "y_offset=%d", l->y_offset);
			printf("\n\t" "type=ImageLayer");
			dump_image(l->content.image, 1);
		}
		dump_prop(l->properties, 1);
		printf("\n}");
	}

	if (l) {
		if (l->next) dump_layer(l->next, tc);
	}
}
コード例 #3
0
static void dump_all(hwc_layer_1_t *layers, unsigned int layerno, unsigned int errlayer)
{
    unsigned int i;
    for (i = 0; i < layerno; i++) {
        hwc_layer_1_t *l = &layers[i];
        OUTE("Layer %d", i);
        dump_layer(l, errlayer == i);
    }
}
コード例 #4
0
ファイル: example.c プロジェクト: Crapoto/tmx
void dump_map(tmx_map m) {
	fputs("map={", stdout);
	if (m) {
		printf("\n\torient=%d", m->orient);
		printf("\n\theight=%d", m->height);
		printf("\n\twidth=%d", m->width);
		printf("\n\ttheight=%d", m->tile_height);
		printf("\n\ttwidth=%d", m->tile_width);
	} else {
		fputs("\n(NULL)", stdout);
	}
	puts("\n}");

	if (m) {
		dump_tileset(m->ts_head);
		dump_prop(m->properties);
		dump_layer(m->ly_head, m->height * m->width);
	}
}
コード例 #5
0
ファイル: dumper.c プロジェクト: jabelardo/tmx
void dump_map(tmx_map *m) {
	fputs("map={", stdout);
	if (m) {
		printf("\n\t" "orient="); print_orient(m->orient);
		printf("\n\t" "renderorder=%d", m->renderorder);
		printf("\n\t" "height=%d", m->height);
		printf("\n\t" "width=%d", m->width);
		printf("\n\t" "theight=%d", m->tile_height);
		printf("\n\t" "twidth=%d", m->tile_width);
		printf("\n\t" "bgcol=#%.6X", m->backgroundcolor);
	} else {
		fputs("\n(NULL)", stdout);
	}
	puts("\n}");

	if (m) {
		dump_tileset(m->ts_head);
		dump_layer(m->ly_head, m->height * m->width);
		dump_prop(m->properties, 0);
	}
}