[android] fixed bug in drawing "empty model" message.

This commit is contained in:
rachytski 2011-12-18 14:30:29 +04:00 committed by Alex Zolotarev
parent ad52f22a49
commit 4d755c2117
4 changed files with 22 additions and 34 deletions

View file

@ -95,11 +95,11 @@ namespace android
try
{
m_work.LoadState();
m_work.SetRenderPolicy(CreateRenderPolicy(m_videoTimer,
true,
rmParams,
make_shared_ptr(new android::RenderContext())));
m_work.LoadState();
}
catch (yg::gl::platform_unsupported const & e)
{

View file

@ -269,10 +269,7 @@ int32_t NVEventAppMain(int32_t argc, char** argv)
// s_glesAutopaused = true;
/// need to investigate deeper, whether i could call it only once in a sequence of lifecycle events
/* if (g_framework)
{
NVDEBUG("saving state");
g_framework->SaveState();
}*/
g_framework->SaveState();*/
renderFrame(false);
break;
@ -280,12 +277,8 @@ int32_t NVEventAppMain(int32_t argc, char** argv)
case NV_EVENT_PAUSE:
NVDEBUG("Pause event");
/* /// need to investigate deeper, whether i could call it only once in a sequence of lifecycle events
if (g_framework)
{
NVDEBUG("saving state");
g_framework->SaveState();
}*/
/* if (g_framework)
g_framework->SaveState();*/
//s_glesAutopaused = true;
renderFrame(false);
@ -294,12 +287,8 @@ int32_t NVEventAppMain(int32_t argc, char** argv)
case NV_EVENT_STOP:
NVDEBUG("Stop event");
/* /// need to investigate deeper, whether i could call it only once in a sequence of lifecycle events
if (g_framework)
{
NVDEBUG("saving state");
g_framework->SaveState();
}*/
/* if (g_framework)
g_framework->SaveState();*/
// As per Google's recommendation, we release GLES resources here
ShutdownGLESResources();
@ -307,12 +296,8 @@ int32_t NVEventAppMain(int32_t argc, char** argv)
case NV_EVENT_QUIT:
NVDEBUG("Quit event");
/* /// need to investigate deeper, whether i could call it only once in a sequence of lifecycle events
if (g_framework)
{
NVDEBUG("saving state");
g_framework->SaveState();
}*/
/* if (g_framework)
g_framework->SaveState();*/
break;
case NV_EVENT_ACCEL:

View file

@ -140,7 +140,7 @@ void RenderQueueRoutine::processResize(ScreenBase const & frameScreen)
}
}
void RenderQueueRoutine::getUpdateAreas(
bool RenderQueueRoutine::getUpdateAreas(
ScreenBase const & oldScreen,
m2::RectI const & oldRect,
ScreenBase const & newScreen,
@ -157,11 +157,11 @@ void RenderQueueRoutine::getUpdateAreas(
/// checking two corner cases
if (o.IsRectInside(n))
return;
return false;
if (!o.IsIntersect(n))
{
areas.push_back(newRect);
return;
return true;
}
double leftBarMinX = 0;
@ -190,6 +190,8 @@ void RenderQueueRoutine::getUpdateAreas(
areas.push_back(m2::RectI((int)rightBarMinX, (int)topBarMaxY, (int)rightBarMaxX, (int)bottomBarMaxY));
if ((int)bottomBarMinY != (int)bottomBarMaxY)
areas.push_back(m2::RectI((int)leftBarMinX, (int)bottomBarMinY, (int)rightBarMinX, (int)bottomBarMaxY));
return false;
}
else
{
@ -228,6 +230,7 @@ void RenderQueueRoutine::getUpdateAreas(
areas.push_back(m2::Offset(r, 0 * sx, 1 * sy));
areas.push_back(m2::Offset(r, 0 * sx, 0 * sy));
}
return true;
}
}
@ -346,13 +349,13 @@ void RenderQueueRoutine::Do()
}
else
{
getUpdateAreas(prevScreen,
prevRect,
m_currentRenderCommand->m_frameScreen,
curRect,
areas);
if ((areas.size() == 1) && (areas[0] == curRect))
fullRectRepaint = true;
fullRectRepaint = getUpdateAreas(prevScreen,
prevRect,
m_currentRenderCommand->m_frameScreen,
curRect,
areas);
/* if ((areas.size() == 1) && (areas[0] == curRect))
fullRectRepaint = true;*/
}
isPanning = IsPanningAndRotate(prevScreen, m_renderState->m_currentScreen);

View file

@ -122,7 +122,7 @@ public:
/// Check, whether the resize command is queued, and resize accordingly.
void processResize(ScreenBase const & frameScreen);
/// Get update areas for the current render state
void getUpdateAreas(ScreenBase const & oldScreen, m2::RectI const & oldRect,
bool getUpdateAreas(ScreenBase const & oldScreen, m2::RectI const & oldRect,
ScreenBase const & newScreen, m2::RectI const & newRect,
vector<m2::RectI> & areas);
/// Thread procedure