diff --git a/client/src/main.c b/client/src/main.c index 0fd6d80f..671ede9a 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -428,6 +429,23 @@ int main_frameThread(void * unused) lgrFormat.stride = frame->stride; lgrFormat.pitch = frame->pitch; + if (frame->height != frame->realHeight) + { + const float needed = + ((frame->realHeight * frame->pitch * 2) / 1048576.0f) + 10.0f; + const int size = (int)powf(2.0f, ceilf(logf(needed) / logf(2.0f))); + + DEBUG_BREAK(); + DEBUG_WARN("IVSHMEM too small, screen truncated"); + DEBUG_WARN("Recommend increase size to %d MiB", size); + DEBUG_BREAK(); + + app_alert(LG_ALERT_ERROR, + "IVSHMEM too small, screen truncated\n" + "Recommend increasing size to %d MiB", + size); + } + switch(frame->rotation) { case FRAME_ROT_0 : lgrFormat.rotate = LG_ROTATE_0 ; break;