#ifdef MAEMO
if ((Config.fullscreen && !gotScreenSize) ||
(!Config.fullscreen && !gotWindowSize)) {
// Do a first try, in order to get window/screen size
#ifdef MAEMO
if ((Config.fullscreen && !gotScreenSize) ||
(!Config.fullscreen && !gotWindowSize)) {
// Do a first try, in order to get window/screen size
- screen = SDL_SetVideoMode(realWidth, realHeight, 16,
+ screen = SDL_SetVideoMode(gameWidth, gameHeight, 16,
SDL_SWSURFACE | SDL_RESIZABLE |
(Config.fullscreen ? SDL_FULLSCREEN : 0));
if (!screen) DIE("SDL_SetVideoMode: %s", SDL_GetError());
calculateScreenSize();
}
if (Config.fullscreen) {
SDL_SWSURFACE | SDL_RESIZABLE |
(Config.fullscreen ? SDL_FULLSCREEN : 0));
if (!screen) DIE("SDL_SetVideoMode: %s", SDL_GetError());
calculateScreenSize();
}
if (Config.fullscreen) {
- // By now, just assume xsp == fullscreen. This has to change.
- Config.xsp = Config.fullscreen;
- if (!Config.xsp) {
+ // So, can we enable Xsp?
+ if (gameWidth * 2 < winWidth && gameHeight * 2 < winHeight) {
+ Config.xsp = true;
+ } else {
+ Config.xsp = false;
- screen = SDL_SetVideoMode(srfWidth, srfHeight,
+ // Safeguard
+ if (gameHeight > winHeight || gameWidth > winWidth)
+ DIE("Video is larger than window size!");
+
+ screen = SDL_SetVideoMode(winWidth, winHeight,
Settings.SixteenBit ? 16 : 8,
SDL_SWSURFACE |
(Config.fullscreen ? SDL_FULLSCREEN : 0));
Settings.SixteenBit ? 16 : 8,
SDL_SWSURFACE |
(Config.fullscreen ? SDL_FULLSCREEN : 0));
- centerRectangle(renderArea, srfWidth, srfHeight,
- realWidth * 2, realHeight * 2);
+ centerRectangle(renderArea, winWidth, winHeight,
+ gameWidth * 2, gameHeight * 2);
- centerRectangle(renderArea, srfWidth, srfHeight, realWidth, realHeight);
+ centerRectangle(renderArea, winWidth, winHeight, gameWidth, gameHeight);
- centerRectangle(renderArea, srfWidth, srfHeight, realWidth, realHeight);
+ centerRectangle(renderArea, winWidth, winHeight, gameWidth, gameHeight);
GFX.PPLx2 = GFX.Pitch;
printf("Video: %dx%d (%dx%d output), %hu bits per pixel, %s %s\n",
GFX.PPLx2 = GFX.Pitch;
printf("Video: %dx%d (%dx%d output), %hu bits per pixel, %s %s\n",
screen->w, screen->h, screen->format->BitsPerPixel,
Config.fullscreen ? "fullscreen" : "windowed",
Config.xsp ? "with pixel doubling" : "");
screen->w, screen->h, screen->format->BitsPerPixel,
Config.fullscreen ? "fullscreen" : "windowed",
Config.xsp ? "with pixel doubling" : "");