enigma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Enigma-devel] Sidebar: How should this be done?


From: Till Harbaum / Lists
Subject: Re: [Enigma-devel] Sidebar: How should this be done?
Date: Sun, 2 Mar 2008 20:54:18 +0100
User-agent: KMail/1.9.6 (enterprise 0.20070907.709405)

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();
}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]