From: Laszlo T. <ave...@us...> - 2005-07-16 23:27:24
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28777/plugins/Core Modified Files: Actor.cpp GameControl.cpp TextArea.cpp TextArea.h Log Message: fixed bug #1239178 Index: Actor.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Actor.cpp,v retrieving revision 1.116 retrieving revision 1.117 diff -C2 -d -r1.116 -r1.117 *** Actor.cpp 16 Jul 2005 21:03:46 -0000 1.116 --- Actor.cpp 16 Jul 2005 23:27:11 -0000 1.117 *************** *** 638,641 **** --- 638,642 ---- //Can't simply set Selected to false, game has its own little list core->GetGame()->SelectActor(this, false, SELECT_NORMAL); + ClearPath(); InternalFlags|=IF_JUSTDIED; if (!InParty) { Index: TextArea.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/TextArea.cpp,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** TextArea.cpp 5 Jun 2005 12:12:10 -0000 1.74 --- TextArea.cpp 16 Jul 2005 23:27:11 -0000 1.75 *************** *** 157,161 **** ftext->Print( Region( x + XPos, y + YPos + ( yl * ftext->size[1].h ), Width, ! Height - 5 - ( yl * ftext->size[1].h) ), ( unsigned char * ) lines[i], pal, IE_FONT_ALIGN_LEFT, true ); yl += lrows[i]; --- 157,161 ---- ftext->Print( Region( x + XPos, y + YPos + ( yl * ftext->size[1].h ), Width, ! Height - 5 - ( yl * ftext->maxHeight) ), ( unsigned char * ) lines[i], pal, IE_FONT_ALIGN_LEFT, true ); yl += lrows[i]; *************** *** 340,343 **** --- 340,348 ---- } + int TextArea::GetVisibleRowCount() + { + return (Height-5) / ftext->maxHeight; + } + /** Returns top index */ int TextArea::GetTopIndex() *************** *** 401,405 **** void TextArea::OnMouseOver(unsigned short /*x*/, unsigned short y) { ! int height = ftext->size[1].h; int r = y / height; int row = 0; --- 406,410 ---- void TextArea::OnMouseOver(unsigned short /*x*/, unsigned short y) { ! int height = ftext->maxHeight; //size[1].h; int r = y / height; int row = 0; *************** *** 490,491 **** --- 495,511 ---- return true; } + + void TextArea::PadMinRow() + { + int rows = 0; + int i=lines.size()-1; + while(i>=minrow-1 && i>=0) { + rows+=lrows[i]; + i--; + } + rows = GetVisibleRowCount()-rows; + while(rows>0) { + AppendText("",-1); + rows--; + } + } Index: TextArea.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/TextArea.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** TextArea.h 10 Apr 2005 19:11:24 -0000 1.23 --- TextArea.h 16 Jul 2005 23:27:12 -0000 1.24 *************** *** 63,70 **** --- 63,79 ---- /** Deletes last `count' lines */ void PopLines(unsigned int count); + /** Deletes last lines up to current 'minrow' */ + void PopMinRow() + { + PopLines(lines.size()-minrow); + } + /** adds empty lines so minrow will be the uppermost visible row */ + void PadMinRow(); /** Sets the Fonts */ void SetFonts(Font* init, Font* text); /** Returns Number of Rows */ int GetRowCount(); + /** Returns Number of Visible Rows */ + int GetVisibleRowCount(); /** Returns Starting Row */ int GetTopIndex(); Index: GameControl.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/GameControl.cpp,v retrieving revision 1.244 retrieving revision 1.245 diff -C2 -d -r1.244 -r1.245 *** GameControl.cpp 16 Jul 2005 21:03:46 -0000 1.244 --- GameControl.cpp 16 Jul 2005 23:27:11 -0000 1.245 *************** *** 1460,1464 **** } ! ta->PopLines( ds->transitionsCount + 1 ); if (tr->textStrRef != 0xffffffff) { core->DisplayStringName( tr->textStrRef, 0x8080FF, speaker); --- 1460,1464 ---- } ! ta->PopMinRow(); if (tr->textStrRef != 0xffffffff) { core->DisplayStringName( tr->textStrRef, 0x8080FF, speaker); *************** *** 1469,1473 **** Action* action = GenerateAction( tr->action->strings[i], true ); if (action) { ! target->AddAction( action ); } else { snprintf(Tmp, sizeof(Tmp), --- 1469,1473 ---- Action* action = GenerateAction( tr->action->strings[i], true ); if (action) { ! target->AddAction( action ); } else { snprintf(Tmp, sizeof(Tmp), *************** *** 1553,1557 **** } end_of_choose: ! ta->AppendText( "", -1 ); // is this correct? if (DialogueFlags & DF_FREEZE_SCRIPTS) { --- 1553,1558 ---- } end_of_choose: ! //padding the rows so our text will be at the top ! ta->PadMinRow(); // is this correct? if (DialogueFlags & DF_FREEZE_SCRIPTS) { |