From: Laszlo T. <ave...@us...> - 2011-08-05 21:33:00
|
gemrb: Infinity Engine emulator The branch master has been updated via 4ce348776cb5ca7cfbfd5bcdc0f32b26686212b5 (commit) via 03dcdb8452653789f2209b7939aca46174d9672d (commit) Summary of changes: gemrb/core/Interface.cpp | 14 ---------- gemrb/core/Map.cpp | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 14 deletions(-) from b6d5023a05c7e01de0ec652e5a576a1a9f4f4236 (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=4ce348776cb5ca7cfbfd5bcdc0f32b26686212b5 commit 4ce348776cb5ca7cfbfd5bcdc0f32b26686212b5 Author: Avenger <ave...@so...> Date: Fri Aug 5 23:32:00 2011 +0200 close current container before destructing its owner map diff --git a/gemrb/core/Map.cpp b/gemrb/core/Map.cpp index edd40ac..00a016d 100644 --- a/gemrb/core/Map.cpp +++ b/gemrb/core/Map.cpp @@ -51,6 +51,7 @@ #include "GUI/Window.h" #include "Scriptable/Container.h" #include "Scriptable/Door.h" +#include "Scriptable/FloatText.h" #include "Scriptable/InfoPoint.h" #include <cmath> @@ -346,6 +347,13 @@ Map::~Map(void) free( MapSet ); free( SrchMap ); + + //close the current container if it was owned by this map, this avoids a crash + Container *c = core->GetCurrentContainer(); + if (c && c->GetCurrentArea()==this) { + core->CloseCurrentContainer(); + } + delete TMap; delete INISpawn; aniIterator aniidx; @@ -1224,6 +1232,12 @@ void Map::DrawMap(Region screen) actor->DrawOverheadText(screen); } + i = texts.size(); + while(i--) { + FloatText* ft = texts[i]; + ft->DrawOverheadText(screen); + } + oldgametime=gametime; } @@ -3718,3 +3732,50 @@ void Map::SetBackground(const ieResRef &bgResRef, ieDword duration) Background = bmp->GetSprite2D(); BgDuration = duration; } + +void Map::AddFloatText(Actor *actor, char *text) +{ + size_t i = texts.size(); + Region nr; + bool display = true; + + nr.h = 20; + nr.w = 100; + nr.x = actor->Pos.x; + nr.y = actor->Pos.y; + + while(i--) { + //cleanup + if (!texts[i]->Height) { + delete texts[i]; + + texts.erase(texts.begin()+i); + continue; + } + + //existing stack + if (texts[i]->owner==actor->GetGlobalID() ) { + texts[i]->AddText(text); + return; + } + + Region r; + + r.h = texts[i]->Height*20; + r.w = 100; + r.x = texts[i]->Pos.x; + r.x = texts[i]->Pos.y; + if (nr.InsideRegion(r)) { + //collision, what to do + display = false; + } + } + + //new stack fits on screen + if (display) { + FloatText *newtext = new FloatText; + newtext->DisplayHeadText(text, actor); + texts.insert(texts.end(),newtext); + } +} + http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=03dcdb8452653789f2209b7939aca46174d9672d commit 03dcdb8452653789f2209b7939aca46174d9672d Author: Avenger <ave...@so...> Date: Fri Aug 5 23:30:09 2011 +0200 cleaned up some old garbage diff --git a/gemrb/core/Interface.cpp b/gemrb/core/Interface.cpp index cdb17a3..5f05376 100644 --- a/gemrb/core/Interface.cpp +++ b/gemrb/core/Interface.cpp @@ -4713,20 +4713,6 @@ Effect *Interface::GetFeatures(int count) return new Effect[count]; } -/* -void Interface::FreeITMExt(ITMExtHeader *p, Effect *e) -{ - delete [] p; - delete [] e; -} - -void Interface::FreeSPLExt(SPLExtHeader *p, Effect *e) -{ - delete [] p; - delete [] e; -} -*/ - WorldMapArray *Interface::NewWorldMapArray(int count) { return new WorldMapArray(count); ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |