mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
fb_generic: add swidth variable, "stride in fb_pixel_t units"
this should allow to use fb_pixel_t pointer arithmetics more often instead of byte pointers
This commit is contained in:
committed by
M. Liebmann
parent
b7110faaf6
commit
7c7d5f08dd
@@ -54,6 +54,7 @@ void CFbAccelGLFB::init(const char *)
|
||||
}
|
||||
screeninfo = glfb->getScreenInfo();
|
||||
stride = 4 * screeninfo.xres;
|
||||
swidth = screeninfo.xres;
|
||||
available = glfb->getOSDBuffer()->size(); /* allocated in glfb constructor */
|
||||
lbb = lfb = reinterpret_cast<fb_pixel_t*>(glfb->getOSDBuffer()->data());
|
||||
|
||||
@@ -135,7 +136,7 @@ int CFbAccelGLFB::setMode(unsigned int, unsigned int, unsigned int)
|
||||
int needmem = stride * yRes * 2;
|
||||
if (available >= needmem)
|
||||
{
|
||||
backbuffer = lfb + stride / sizeof(fb_pixel_t) * yRes;
|
||||
backbuffer = lfb + swidth * yRes;
|
||||
return 0;
|
||||
}
|
||||
fprintf(stderr, LOGTAG " not enough FB memory (have %d, need %d)\n", available, needmem);
|
||||
|
Reference in New Issue
Block a user