Code: Select all
//draw main game
scene->setActiveCamera(camera);
scene->drawAll();
if (showMap)
{
//draw overhead map cam - Activate mapcam and set the viewpoint. draw.
scene->setActiveCamera(mapcamera);
mapcamera->setPosition(vector3df(camera->getPosition().X,maxheight+spacer,camera->getPosition().Z));
mapcamera->setTarget(camera->getPosition());
driver->setViewPort(rect<s32>(10,10,driver->getScreenSize().Width/6,driver->getScreenSize().Height/6));
scene->drawAll();
}
//draw gui
driver->setViewPort(rect<s32>(0,0,game::driver->getScreenSize().Width,game::driver->getScreenSize().Height));
gui->drawAll();
THis puts a minimap in the upper left. Two issues:
a) When theres something being drawn behind the map viewport, the map viewport will only show the sky (Pic 1 and 2)
b) The lighting and shading gets messed up while the map is on. (see pic 2 and 3)
Here are some screenshots of the issues:
Note in the below, the minimap draws partially, but where there are buildings it only draws sky still.
Note the above and below shading differences with and without the minimap