+ if (!(flags & SDL_DOUBLEBUF) && pdata->cfg_force_doublebuf) {
+ log("forcing SDL_DOUBLEBUF");
+ flags |= SDL_DOUBLEBUF;
+ }
+
+ if (pdata->border_l | pdata->border_r | pdata->border_t | pdata->border_b) {
+ if (pdata->border_l + pdata->border_r >= width
+ || pdata->border_t + pdata->border_b >= height)
+ {
+ err("specified border too large, ignoring");
+ pdata->border_l = pdata->border_r = pdata->border_t = pdata->border_b = 0;
+ }
+ }
+
+ doublebuf = (flags & SDL_DOUBLEBUF) ? 1 : 0;
+ fbmem = osdl_video_set_mode(pdata,
+ pdata->border_l, pdata->border_r, pdata->border_t, pdata->border_b,
+ width, height, bpp, &doublebuf);
+ if (fbmem == NULL) {
+ err("failing on mode %dx%d@%d, doublebuf %s, border %d,%d,%d,%d",
+ width, height, bpp, (flags & SDL_DOUBLEBUF) ? "on" : "off",
+ pdata->border_l, pdata->border_r, pdata->border_t, pdata->border_b);