Example #1
0
void MapRenderer::render(std::vector<Renderable> &r, std::vector<Renderable> &r_dead) {

	if (shaky_cam_ticks == 0) {
		shakycam.x = cam.x;
		shakycam.y = cam.y;
	}
	else {
		shakycam.x = cam.x + (rand() % 16 - 8) * 0.0078125f;
		shakycam.y = cam.y + (rand() % 16 - 8) * 0.0078125f;
	}

	if (TILESET_ORIENTATION == TILESET_ORTHOGONAL) {
		calculatePriosOrtho(r);
		calculatePriosOrtho(r_dead);
		std::sort(r.begin(), r.end(), priocompare);
		std::sort(r_dead.begin(), r_dead.end(), priocompare);
		renderOrtho(r, r_dead);
	}
	else {
		calculatePriosIso(r);
		calculatePriosIso(r_dead);
		std::sort(r.begin(), r.end(), priocompare);
		std::sort(r_dead.begin(), r_dead.end(), priocompare);
		renderIso(r, r_dead);
	}
}
Example #2
0
void MenuMiniMap::render(MapCollision *collider, Point hero_pos, int map_w, int map_h) {

	if (TILESET_ORIENTATION == TILESET_ISOMETRIC)
		renderIso(collider, hero_pos, map_w, map_h);
	else // TILESET_ORTHOGONAL
		renderOrtho(collider, hero_pos, map_w, map_h);
}