diff options
author | Patrice Mandin <pmandin@caramail.com> | 2008-08-30 23:53:10 +0200 |
---|---|---|
committer | Patrice Mandin <pmandin@caramail.com> | 2008-08-30 23:53:10 +0200 |
commit | d530595cd82eae088667655f49affc771a572ca5 (patch) | |
tree | 5e6b2ac6d615537243ada367eedeb0a65ad5742b | |
parent | 492852e1591dc39756db6a357748f221d1ad0e7b (diff) |
Only align if not multiple of 256
-rw-r--r-- | screen.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -58,7 +58,9 @@ int screen_open(int width, int height, int bpp) screen_bpp = bpp; screen_offset = 0; /* Can we get front buffer offset in vram? */ screen_pitch = screen_width*(screen_bpp/8); - screen_pitch = (screen_pitch | 255)+1; /* Align on 256 bytes boundary */ + if ((screen_pitch & 255)!=0) { + screen_pitch = (screen_pitch | 255)+1; /* Align on 256 bytes boundary */ + } printf("Screen: %dx%dx%d, pitch=%d, offset=0x%08x\n", screen_width, screen_height, screen_bpp, |