Am Sonntag 02 März 2008 schrieb Pipeline:
> Thanks, i got it working... but i had to revert your changes back to
> default display.cc or else game area would stay left justified.
While that's working in this case, it's definitely not how it was meant to be. 
My initial patch was missing the inclusion of the x and y offsets. This 
version works with the gamearea located at any position:

 void GameDisplay::resize_game_area (int w, int h) 
{
    DisplayEngine *e = get_engine();
    int neww = w * e->get_tilew();
    int newh = h * e->get_tileh();

    const video::VMInfo *vidinfo = video::GetInfo();

    int screenw = vidinfo->gamearea.w;
    int screenh = vidinfo->gamearea.h;

    if (neww > screenw || newh > screenh) {
        enigma::Log << "Illegal screen size ("<< neww << "," << newh
                    << "): larger than physical display\n";
        return;
    }
    Rect r (vidinfo->gamearea.x + (screenw-neww)/2, 
            vidinfo->gamearea.y + (screenh-newh)/2, neww, newh);

    e->set_screen_area (r);
    follow_center();
}


_______________________________________________
Enigma-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/enigma-devel

Reply via email to