#! /bin/sh /usr/share/dpatch/dpatch-run ## 02_support1MB.dpatch by Thomas Günther ## http://toms-cafe.de/vdr/download/osdtest256-0.1.0-support1MB.diff ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Check whether the OSD can display the 4MB area, shrink it if necessary. @DPATCH@ --- osdtest256-0.1.0/osdtest256.c +++ osdtest256-0.1.0/osdtest256.c @@ -29,19 +29,27 @@ if (osd) { tArea Area = { 0, 0, 599, 499, 8 }; + if (osd->CanHandleAreas(&Area, 1) != oeOk) + { + // Set 1MB area + Area.x2 = 359; + Area.y2 = 251; + } osd->SetAreas(&Area, 1); - osd->DrawRectangle(0, 0, 599, 499, clrGray50); + osd->DrawRectangle(0, 0, Area.x2, Area.y2, clrGray50); + int w = Area.Width() / 60; + int h = Area.Height() / 5; for (int i = 0; i < 60; i++) - osd->DrawRectangle(10*i, 0,10*(i+1), 99, 0xff000000+0x040404*(60-i)); + osd->DrawRectangle(w*i, 0,w*(i+1), h-1, 0xff000000+0x040404*(60-i)); for (int i = 0; i < 60; i++) - osd->DrawRectangle(10*i,100,10*(i+1),199, 0xff000000+((15+i*4)<<16)); + osd->DrawRectangle(w*i, h,w*(i+1),2*h-1, 0xff000000+((15+i*4)<<16)); for (int i = 0; i < 60; i++) - osd->DrawRectangle(10*i,200,10*(i+1),299, 0xff000000+((15+(60-i)*4)<<8)); + osd->DrawRectangle(w*i,2*h,w*(i+1),3*h-1, 0xff000000+((15+(60-i)*4)<<8)); for (int i = 0; i < 60; i++) - osd->DrawRectangle(10*i,300,10*(i+1),399, 0xff000000+(15+i*4)); + osd->DrawRectangle(w*i,3*h,w*(i+1),4*h-1, 0xff000000+(15+i*4)); for (int i = 0; i < 60; i++) - osd->DrawRectangle(10*i,400,10*(i+1),499, 0xff000000+0x040404*(60-i)); + osd->DrawRectangle(w*i,4*h,w*(i+1),5*h-1, 0xff000000+0x040404*(60-i)); osd->Flush(); }