/* Process command function to send commands or sleep.  */
void ProcessCommand(CLR_RT_HeapBlock_Array *array)
/* Process command function to send commands or sleep.  */
void ProcessCommand(CLR_RT_HeapBlock_Array *array)
{
    CLR_UINT32 numberElements = array->m_numOfElements;
    CLR_UINT32 inc = 0;
    CLR_UINT8 *cmd;
    CLR_UINT8 *size;
    while (inc < numberElements)
    {
        cmd = array->GetElement(inc++);
        size = array->GetElement(inc++);
        if (*cmd == GraphicDriverCommandType::GraphicDriverCommandType_Sleep)
        {
            OS_DELAY(*cmd * *size * 10);
        }
        else if (*cmd == GraphicDriverCommandType::GraphicDriverCommandType_Command)
        {
            g_DisplayInterface.WriteToFrameBuffer(*array->GetElement(inc), array->GetElement(inc + 1), *size - 1, 0);
            inc += *size;
        }
        else
        {
            inc++;
        }
    }
}