Пример #1
0
void P3::redraw(Window *w)
{
	int sceneToRender = w->SceneToRender();
	if (sceneToRender < 0) sceneToRender *= -1;
	sceneToRender %= SCENE_COUNT;

	if (sceneToRender == 0)
		renderViewport(w);
	else if (sceneToRender == 1)
		render1OverW(w);
	else if (sceneToRender == 2)
		renderDepthBuffer(w);
	else if (sceneToRender == 3)
		renderEasyPointClipping(w);
	else if (sceneToRender == 4)
		renderMatrixManips(w);
	else if (sceneToRender == 5)
		renderMatrixStacks(w);
	else if (sceneToRender == 6)
		renderRotate(w);
	else if (sceneToRender == 7)
		renderTranslate(w);
	else if (sceneToRender == 8)
		renderScale(w);
	else if (sceneToRender == 9)
		renderOrtho(w);
	else if (sceneToRender == 10)
		renderLookAt(w);
	else if (sceneToRender == 11)
		renderScaleFix(w);
}
Пример #2
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);
	}
}
Пример #3
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);
}