summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrice Mandin <pmandin@caramail.com>2008-08-30 23:53:10 +0200
committerPatrice Mandin <pmandin@caramail.com>2008-08-30 23:53:10 +0200
commitd530595cd82eae088667655f49affc771a572ca5 (patch)
tree5e6b2ac6d615537243ada367eedeb0a65ad5742b
parent492852e1591dc39756db6a357748f221d1ad0e7b (diff)
Only align if not multiple of 256
-rw-r--r--screen.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/screen.c b/screen.c
index 9b378f2..73e7ca5 100644
--- a/screen.c
+++ b/screen.c
@@ -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,