fix display init bug, update readme

This commit is contained in:
idea4good
2020-05-23 00:29:24 +08:00
parent 06a68e056a
commit 841c283e17
4 changed files with 21 additions and 4 deletions

View File

@@ -56,7 +56,7 @@ public:
int snap_shot(const char* file_name)
{
if (!m_phy_fb)
if (!m_phy_fb || (m_color_bytes !=2 && m_color_bytes != 4))
{
return -1;
}
@@ -605,6 +605,7 @@ inline c_display::c_display(void* phy_fb, int display_width, int display_height,
inline c_display::c_display(void* phy_fb, int display_width, int display_height, c_surface* surface) : m_width(display_width), m_height(display_height), m_phy_fb(phy_fb), m_phy_read_index(0), m_phy_write_index(0), m_surface_cnt(1), m_surface_index(0)
{
m_color_bytes = surface->m_color_bytes;
surface->m_is_active = true;
(m_surface_group[0] = surface)->attach_display(this);
}