Fix some corruption in server only stk

This commit is contained in:
Benau 2018-03-06 13:11:05 +08:00
parent 66626e4ea8
commit 821a00c039
2 changed files with 5 additions and 8 deletions

View File

@ -303,7 +303,6 @@ core::recti IrrDriver::getSplitscreenWindow(int WindowNum)
const int x_grid_Position = WindowNum % cols;
const int y_grid_Position = int(floor((WindowNum) / cols));
int wid = (int)irr_driver->getActualScreenSize().Width;
//To prevent the viewport going over the right side, we use std::min to ensure the right corners are never larger than the total width
return core::recti(
@ -715,8 +714,8 @@ void IrrDriver::initDevice()
// set cursor visible by default (what's the default is not too clearly documented,
// so let's decide ourselves...)
m_device->getCursorControl()->setVisible(true);
m_pointer_shown = true;
#endif
m_pointer_shown = true;
} // initDevice
// ----------------------------------------------------------------------------
@ -786,16 +785,19 @@ void IrrDriver::getOpenGLData(std::string *vendor, std::string *renderer,
//-----------------------------------------------------------------------------
void IrrDriver::showPointer()
{
#ifndef SERVER_ONLY
if (!m_pointer_shown)
{
m_pointer_shown = true;
this->getDevice()->getCursorControl()->setVisible(true);
}
#endif
} // showPointer
//-----------------------------------------------------------------------------
void IrrDriver::hidePointer()
{
#ifndef SERVER_ONLY
// always visible in artist debug mode, to be able to use the context menu
if (UserConfigParams::m_artist_debug_mode)
{
@ -808,6 +810,7 @@ void IrrDriver::hidePointer()
m_pointer_shown = false;
this->getDevice()->getCursorControl()->setVisible(false);
}
#endif
} // hidePointer
//-----------------------------------------------------------------------------

View File

@ -1185,11 +1185,7 @@ bool Track::loadMainTrack(const XMLNode &root)
scene::CBatchingMesh *merged_mesh = new scene::CBatchingMesh();
merged_mesh->addMesh(mesh);
merged_mesh->finalize();
#ifndef SERVER_ONLY
tangent_mesh = merged_mesh;
#else
tangent_mesh = merged_mesh;
#endif
// The reference count of the mesh is 1, since it is in irrlicht's
// cache. So we only have to remove it from the cache.
irr_driver->removeMeshFromCache(mesh);
@ -1198,9 +1194,7 @@ bool Track::loadMainTrack(const XMLNode &root)
{
// SPM does the combine for you
tangent_mesh = mesh;
#ifndef SERVER_ONLY
tangent_mesh->grab();
#endif
}
// The merged mesh is grabbed by the octtree, so we don't need
// to keep a reference to it.