From: Laszlo T. <ave...@us...> - 2010-09-26 13:13:25
|
gemrb: Infinity Engine emulator The branch master has been updated via b48997cb1acdea49f6de9682ee9aa8eeb18c6799 (commit) Summary of changes: gemrb/GUIScripts/TextScreen.py | 8 +++++--- gemrb/core/GUI/GameControl.cpp | 15 ++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) from c7a93c133f569d95bebf64d2637a5bfdf6924d30 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=b48997cb1acdea49f6de9682ee9aa8eeb18c6799 commit b48997cb1acdea49f6de9682ee9aa8eeb18c6799 Author: Avenger <ave...@so...> Date: Sun Sep 26 15:12:30 2010 +0200 fixed crash when gamecontrol already exists but no area loaded yet diff --git a/gemrb/GUIScripts/TextScreen.py b/gemrb/GUIScripts/TextScreen.py index 68b198d..bb0ee76 100644 --- a/gemrb/GUIScripts/TextScreen.py +++ b/gemrb/GUIScripts/TextScreen.py @@ -53,16 +53,18 @@ def StartTextScreen (): ID = (GemRB.GetGameVar("CHAPTER") + 1) & 0x7fffffff Chapter = ID + 1 - if GUICommon.GameIsIWD1() or GUICommon.GameIsIWD2(): - #fixme: this is also a guess; are there more, one per chapter? + #iwd2/bg2 has no separate music + if GUICommon.GameIsIWD1(): if LoadPic == "": GemRB.LoadMusicPL ("chap0.mus") else: GemRB.LoadMusicPL ("chap1.mus") TableName = "chapters" + elif GUICommon.GameIsIWD2(): + GemRB.HardEndPL () + TableName = "chapters" elif GUICommon.GameIsBG1() and TableName[:6] == "chptxt": GemRB.LoadMusicPL ("chapter.mus") - #else: TODO: what about bg2? TextScreen = GemRB.LoadWindow (ID) TextScreen.SetFrame () diff --git a/gemrb/core/GUI/GameControl.cpp b/gemrb/core/GUI/GameControl.cpp index f07b424..608de29 100644 --- a/gemrb/core/GUI/GameControl.cpp +++ b/gemrb/core/GUI/GameControl.cpp @@ -364,12 +364,19 @@ void GameControl::Draw(unsigned short x, unsigned short y) return; } + Region screen( x + XPos, y + YPos, Width, Height ); + Map *area = core->GetGame()->GetCurrentArea(); Video* video = core->GetVideoDriver(); + if (!area) { + video->DrawRect( screen, blue, true ); + return; + } + Region viewport = video->GetViewport(); if (moveX || moveY) { viewport.x += moveX; viewport.y += moveY; - Point mapsize = core->GetGame()->GetCurrentArea()->TMap->GetMapSize(); + Point mapsize = area->TMap->GetMapSize(); if ( viewport.x < 0 )//if we are at top of the map viewport.x = 0; else if ( (viewport.x + viewport.w) >= mapsize.x) //if we are at the bottom @@ -385,12 +392,6 @@ void GameControl::Draw(unsigned short x, unsigned short y) // move it directly ourselves, since we might be paused video->MoveViewportTo( viewport.x, viewport.y ); } - Region screen( x + XPos, y + YPos, Width, Height ); - Map* area = game->GetCurrentArea( ); - if (!area) { - video->DrawRect( screen, blue, true ); - return; - } video->DrawRect( screen, black, true ); // setup outlines ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |