}
screens.erase(screens.begin(), screens.end());
- bool show_only_main_screen = (USE_SPLITSCREEN && screens.size() == 1);
-
#if !USE_SPLITSCREEN
RotateScreen *rs = new RotateScreen();
mainscreen = rs;
}
}
+ bool show_only_main_screen = (USE_SPLITSCREEN && screens.size() == 1);
+
/*
* Show auxilliary screens except if we have too many already,
* or if we're in the special split-screen end-tournament mode,
}
if (mainscreen && mainscreen->check_invalidated()) {
- mainscreen->draw(framebuf, SCREEN_WIDTH, SCREEN_HEIGHT);
- SDL_LockSurface(screen);
- for (unsigned y = 0; y < SCREEN_HEIGHT; ++y) {
- unsigned char *sptr = framebuf + y * SCREEN_WIDTH * 4;
- unsigned char *dptr = (unsigned char *)screen->pixels + y * screen->pitch;
- memcpy(dptr, sptr, SCREEN_WIDTH * 4);
+ if (screen->pitch == SCREEN_WIDTH * 4) {
+ SDL_LockSurface(screen);
+ mainscreen->draw((unsigned char *)screen->pixels, SCREEN_WIDTH, SCREEN_HEIGHT);
+ SDL_UnlockSurface(screen);
+ } else {
+ mainscreen->draw(framebuf, SCREEN_WIDTH, SCREEN_HEIGHT);
+ SDL_LockSurface(screen);
+ for (unsigned y = 0; y < SCREEN_HEIGHT; ++y) {
+ unsigned char *sptr = framebuf + y * SCREEN_WIDTH * 4;
+ unsigned char *dptr = (unsigned char *)screen->pixels + y * screen->pitch;
+ memcpy(dptr, sptr, SCREEN_WIDTH * 4);
+ }
+ SDL_UnlockSurface(screen);
}
- SDL_UnlockSurface(screen);
SDL_Flip(screen);
conn.await_notification(0, 10000);
} else {