From: <ave...@us...> - 2008-08-01 15:55:23
|
Revision: 5239 http://gemrb.svn.sourceforge.net/gemrb/?rev=5239&view=rev Author: avenger_teambg Date: 2008-08-01 15:55:31 +0000 (Fri, 01 Aug 2008) Log Message: ----------- crash fix for nonexistent spells Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2008-07-28 16:53:12 UTC (rev 5238) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2008-08-01 15:55:31 UTC (rev 5239) @@ -1159,6 +1159,11 @@ CREMemorizedSpell *si; //spell casting at target si = source->spellbook.GetMemorizedSpell(spellOrItem, spellSlot, spellIndex); + if (!si) + { + target_mode = TARGET_MODE_NONE; + return; + } sprintf(action->string0Parameter,"%.8s",si->SpellResRef); } else @@ -1193,6 +1198,11 @@ CREMemorizedSpell *si; //spell casting at target si = source->spellbook.GetMemorizedSpell(spellOrItem, spellSlot, spellIndex); + if (!si) + { + target_mode = TARGET_MODE_NONE; + return; + } sprintf(action->string0Parameter,"%.8s",si->SpellResRef); } else @@ -2185,13 +2195,13 @@ ta->PadMinRow(); } // is this correct? - /* this was moved upwards before evaluating the triggers + /* this was moved upwards before evaluating the triggers if (DialogueFlags & DF_FREEZE_SCRIPTS) { target->ProcessActions(true); //clear queued actions that remained stacked? target->ClearActions(); } - */ + */ } void GameControl::DisplayString(Point &p, const char *Text) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2008-09-06 19:05:22
|
Revision: 5256 http://gemrb.svn.sourceforge.net/gemrb/?rev=5256&view=rev Author: avenger_teambg Date: 2008-09-06 19:05:32 +0000 (Sat, 06 Sep 2008) Log Message: ----------- added mousewheel support for GameControl too Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2008-09-06 18:57:01 UTC (rev 5255) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2008-09-06 19:05:32 UTC (rev 5256) @@ -1346,18 +1346,29 @@ void GameControl::OnMouseDown(unsigned short x, unsigned short y, unsigned char Button, unsigned short /*Mod*/) { - if ((ScreenFlags&SF_DISABLEMOUSE) || (Button != GEM_MB_ACTION) ) { + if (ScreenFlags&SF_DISABLEMOUSE) return; + + short px=x; + short py=y; + switch(Button) + { + case GEM_MB_SCRLUP: + OnSpecialKeyPress(GEM_UP); + break; + case GEM_MB_SCRLDOWN: + OnSpecialKeyPress(GEM_DOWN); + break; + case GEM_MB_ACTION: + core->GetVideoDriver()->ConvertToGame( px, py ); + MouseIsDown = true; + SelectionRect.x = px; + SelectionRect.y = py; + StartX = px; + StartY = py; + SelectionRect.w = 0; + SelectionRect.h = 0; } - Point p(x,y); - core->GetVideoDriver()->ConvertToGame( p.x, p.y ); - MouseIsDown = true; - SelectionRect.x = p.x; - SelectionRect.y = p.y; - StartX = p.x; - StartY = p.y; - SelectionRect.w = 0; - SelectionRect.h = 0; } /** Mouse Button Up */ void GameControl::OnMouseUp(unsigned short x, unsigned short y, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2008-12-02 20:39:07
|
Revision: 5489 http://gemrb.svn.sourceforge.net/gemrb/?rev=5489&view=rev Author: avenger_teambg Date: 2008-12-02 20:39:04 +0000 (Tue, 02 Dec 2008) Log Message: ----------- implemented hard pause (tab key) as in ToB - for all games Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2008-11-30 19:46:19 UTC (rev 5488) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2008-12-02 20:39:04 UTC (rev 5489) @@ -41,7 +41,6 @@ #define DEBUG_SHOW_DOORS DEBUG_SHOW_CONTAINERS #define DEBUG_SHOW_SEARCHMAP 0x04 #define DEBUG_SHOW_LIGHTMAP 0x08 -#define DEBUG_XXX 0x10 static const Color cyan = { 0x00, 0xff, 0xff, 0xff @@ -572,16 +571,6 @@ case '9': SelectActor(Key-'1'); break; - /* - case ' ': - DialogueFlags ^= DF_FREEZE_SCRIPTS; - if (DialogueFlags&DF_FREEZE_SCRIPTS) { - core->DisplayConstantString(STR_PAUSED,0xff0000); - } else { - core->DisplayConstantString(STR_UNPAUSED,0xff0000); - } - break; - */ default: core->GetGame()->SetHotKey(toupper(Key)); break; @@ -884,6 +873,9 @@ return; //return from cheatkeys } switch (Key) { + case '\t': + if (DialogueFlags & DF_FREEZE_SCRIPTS) break; + //fallthrough case ' ': DialogueFlags ^= DF_FREEZE_SCRIPTS; if (DialogueFlags&DF_FREEZE_SCRIPTS) { @@ -898,11 +890,6 @@ case GEM_ALT: DebugFlags &= ~DEBUG_SHOW_CONTAINERS; break; - case '\t': - //not GEM_TAB - DebugFlags &= ~DEBUG_XXX; - printf( "TAB released\n" ); - return; default: break; } @@ -1617,8 +1604,7 @@ DebugFlags |= DEBUG_SHOW_CONTAINERS; return; case GEM_TAB: - DebugFlags |= DEBUG_XXX; - printf( "TAB pressed\n" ); + //no effect, i think return; case GEM_MOUSEOUT: moveX = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-01-28 20:19:36
|
Revision: 5563 http://gemrb.svn.sourceforge.net/gemrb/?rev=5563&view=rev Author: fuzzie Date: 2009-01-28 20:19:33 +0000 (Wed, 28 Jan 2009) Log Message: ----------- check for a relevant target_mode before relying on the value of spellCount Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-01-28 19:23:23 UTC (rev 5562) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-01-28 20:19:33 UTC (rev 5563) @@ -1302,7 +1302,7 @@ { char Tmp[256]; - if (spellCount) { + if ((target_mode&TARGET_MODE_CAST) && spellCount) { //we'll get the container back from the coordinates TryToCast(actor, container->Pos); return; @@ -1329,7 +1329,7 @@ { char Tmp[256]; - if (spellCount) { + if ((target_mode&TARGET_MODE_CAST) && spellCount) { //we'll get the door back from the coordinates TryToCast(actor, door->Pos); return; @@ -1360,7 +1360,7 @@ bool GameControl::HandleActiveRegion(InfoPoint *trap, Actor * actor, Point &p) { - if (spellCount) { + if ((target_mode&TARGET_MODE_CAST) && spellCount) { //we'll get the active region from the coordinates (if needed) TryToCast(actor, p); //don't bother with this region further @@ -1509,7 +1509,7 @@ //just a single actor, no formation if (game->selected.size()==1) { //the player is using an item or spell on the ground - if (spellCount) { + if ((target_mode&TARGET_MODE_CAST) && spellCount) { TryToCast(core->GetFirstSelectedPC(false), p); return; } @@ -1574,7 +1574,7 @@ //we shouldn't zero this for two reasons in case of spell or item //1. there could be multiple targets //2. the target mode is important - if (!spellCount) { + if (!(target_mode&TARGET_MODE_CAST) || !spellCount) { target_mode = TARGET_MODE_NONE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-01-30 17:30:38
|
Revision: 5584 http://gemrb.svn.sourceforge.net/gemrb/?rev=5584&view=rev Author: fuzzie Date: 2009-01-30 17:30:33 +0000 (Fri, 30 Jan 2009) Log Message: ----------- use better cursors/highlights for containers/doors Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-01-30 17:29:34 UTC (rev 5583) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-01-30 17:30:33 UTC (rev 5584) @@ -344,6 +344,8 @@ video->DrawRect( screen, black, true ); // setup outlines + bool targetting = (target_mode & (TARGET_MODE_CAST | + TARGET_MODE_PICK | TARGET_MODE_ATTACK | TARGET_MODE_DEFEND)); InfoPoint *i; for (unsigned int idx = 0; (i = area->TMap->GetInfoPoint( idx )); idx++) { i->Highlight = false; @@ -359,9 +361,20 @@ Door *d; for (unsigned int idx = 0; (d = area->TMap->GetDoor( idx )); idx++) { d->Highlight = false; - if (overDoor == d) { - d->outlineColor = cyan; // TODO: right order? - } else if (d->VisibleTrap(0)) { + if (overDoor == d && targetting) { + if (d->VisibleTrap(0) || (d->Flags & DOOR_LOCKED)) { + // only highlight targettable doors + d->outlineColor = green; + d->Highlight = true; + continue; + } + } else if (overDoor == d && !(d->Flags & DOOR_SECRET)) { + // mouse over, not in target mode, no secret door + d->outlineColor = cyan; + d->Highlight = true; + continue; + } + if (d->VisibleTrap(0)) { d->outlineColor = red; // traps } else if (d->Flags & DOOR_SECRET) { if (DebugFlags & DEBUG_SHOW_DOORS || d->Flags & DOOR_FOUND) { @@ -380,12 +393,23 @@ Container *c; for (unsigned int idx = 0; (c = area->TMap->GetContainer( idx )); idx++) { c->Highlight = false; - if (overContainer == c) { + if (overContainer == c && targetting) { + if (c->VisibleTrap(0) || (c->Flags & CONT_LOCKED)) { + // only highlight targettable containers + c->outlineColor = green; + c->Highlight = true; + continue; + } + } else if (overContainer == c) { + // mouse over, not in target mode c->outlineColor = cyan; - } else if (c->VisibleTrap(0)) { + c->Highlight = true; + continue; + } + if (c->VisibleTrap(0)) { c->outlineColor = red; // traps } else if (DebugFlags & DEBUG_SHOW_CONTAINERS) { - c->outlineColor = cyan; + c->outlineColor = cyan; // debug containers } else { continue; } @@ -859,31 +883,30 @@ int GameControl::GetCursorOverDoor(Door *overDoor) { - overDoor->Highlight = true; - if (overDoor->TrapDetected && overDoor->Trapped) { - overDoor->outlineColor = red; - return IE_CURSOR_TRAP; + if (target_mode&TARGET_MODE_PICK) { + if (overDoor->VisibleTrap(0)) { + return IE_CURSOR_TRAP; + } + if (overDoor->Flags & DOOR_LOCKED) { + return IE_CURSOR_LOCK; + } + + return IE_CURSOR_STEALTH|IE_CURSOR_GRAY; } - overDoor->outlineColor = cyan; - if (overDoor->Flags & DOOR_LOCKED) { - return IE_CURSOR_LOCK; - } return overDoor->Cursor; } int GameControl::GetCursorOverContainer(Container *overContainer) { - overContainer->Highlight = true; - if (overContainer->TrapDetected && overContainer->Trapped) { - overContainer->outlineColor = red; - return IE_CURSOR_TRAP; - } - overContainer->outlineColor = cyan; - if (overContainer->Type==IE_CONTAINER_PILE) { - return IE_CURSOR_TAKE; - } if (target_mode&TARGET_MODE_PICK) { - return IE_CURSOR_LOCK2; + if (overContainer->VisibleTrap(0)) { + return IE_CURSOR_TRAP; + } + if (overContainer->Flags & CONT_LOCKED) { + return IE_CURSOR_LOCK2; + } + + return IE_CURSOR_STEALTH|IE_CURSOR_GRAY; } return IE_CURSOR_TAKE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2009-02-07 23:03:28
|
Revision: 5675 http://gemrb.svn.sourceforge.net/gemrb/?rev=5675&view=rev Author: avenger_teambg Date: 2009-02-07 23:03:24 +0000 (Sat, 07 Feb 2009) Log Message: ----------- fixed msvc 6 compilation problem Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-02-07 22:56:55 UTC (rev 5674) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-02-07 23:03:24 UTC (rev 5675) @@ -189,7 +189,7 @@ angle = atan(xdiff/ydiff); if (ydiff < 0) angle += M_PI; } - + // calculate new coordinates by rotating formation around (0,0) double newx = -formations[formation][pos].x * cos(angle) + formations[formation][pos].y * sin(angle); double newy = formations[formation][pos].x * sin(angle) + formations[formation][pos].y * cos(angle); @@ -336,7 +336,7 @@ viewport.y = 0; else if ( (viewport.y + viewport.h ) >= mapsize.y ) //if we are at the right viewport.y = mapsize.y - viewport.h; - + core->timer->SetMoveViewPort( viewport.x, viewport.y, 0, false ); } Region screen( x + XPos, y + YPos, Width, Height ); @@ -351,7 +351,8 @@ bool targetting = (target_mode & (TARGET_MODE_CAST | TARGET_MODE_PICK | TARGET_MODE_ATTACK | TARGET_MODE_DEFEND)); InfoPoint *i; - for (unsigned int idx = 0; (i = area->TMap->GetInfoPoint( idx )); idx++) { + unsigned int idx; + for (idx = 0; (i = area->TMap->GetInfoPoint( idx )); idx++) { i->Highlight = false; if (i->VisibleTrap(DebugFlags & DEBUG_SHOW_INFOPOINTS)) { i->outlineColor = red; // traps @@ -362,8 +363,9 @@ } i->Highlight = true; } + Door *d; - for (unsigned int idx = 0; (d = area->TMap->GetDoor( idx )); idx++) { + for (idx = 0; (d = area->TMap->GetDoor( idx )); idx++) { d->Highlight = false; if (overDoor == d && targetting) { if (d->VisibleTrap(0) || (d->Flags & DOOR_LOCKED)) { @@ -395,7 +397,7 @@ d->Highlight = true; } Container *c; - for (unsigned int idx = 0; (c = area->TMap->GetContainer( idx )); idx++) { + for (idx = 0; (c = area->TMap->GetContainer( idx )); idx++) { c->Highlight = false; if (overContainer == c && targetting) { if (c->VisibleTrap(0) || (c->Flags & CONT_LOCKED)) { @@ -419,7 +421,7 @@ } c->Highlight = true; } - + //drawmap should be here so it updates fog of war area->DrawMap( screen ); game->DrawWeather(screen, update_scripts); @@ -1052,7 +1054,7 @@ if (ScreenFlags & SF_DISABLEMOUSE) { return; } - + if (Owner->Visible!=WINDOW_VISIBLE) { return; } @@ -1088,7 +1090,7 @@ void GameControl::UpdateScrolling() { if (!scrolling) return; - + int mousescrollspd = core->GetMouseScrollSpeed(); // TODO: why check against this value and not +/-? Video* video = core->GetVideoDriver(); @@ -1521,8 +1523,8 @@ // TODO: this is beyond horrible, help std::vector<Actor *> party; // first, from the actual party - for (int i = 0; i < game->GetPartySize(false); i++) { - Actor *pc = game->FindPC(i + 1); + for (int idx = 0; idx < game->GetPartySize(false); idx++) { + Actor *pc = game->FindPC(idx + 1); if (!pc) continue; for (unsigned int j = 0; j < game->selected.size(); j++) { @@ -1531,8 +1533,9 @@ } } } + // then, anything else we selected - for (unsigned int i = 0; i < game->selected.size(); i++) { + for (i = 0; i < game->selected.size(); i++) { bool found = false; for (unsigned int j = 0; j < party.size(); j++) { if (game->selected[i] == party[j]) { @@ -1542,10 +1545,10 @@ } if (!found) party.push_back(game->selected[i]); } - + //party formation movement Point src = party[0]->Pos; - for(unsigned int i = 0; i < party.size(); i++) { + for(i = 0; i < party.size(); i++) { actor = party[i]; actor->ClearPath(); actor->ClearActions(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-02-11 15:01:18
|
Revision: 5683 http://gemrb.svn.sourceforge.net/gemrb/?rev=5683&view=rev Author: fuzzie Date: 2009-02-11 15:01:09 +0000 (Wed, 11 Feb 2009) Log Message: ----------- try to handle unexpected errors in DialogChoose Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-02-11 12:11:20 UTC (rev 5682) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-02-11 15:01:09 UTC (rev 5683) @@ -1988,6 +1988,10 @@ void GameControl::InitDialog(Scriptable* spk, Scriptable* tgt, const char* dlgref) { + if (dlg) { + delete dlg; + dlg = NULL; + } if (tgt->GetInternalFlag()&IF_NOINT) { core->DisplayConstantString(STR_TARGETBUSY,0xff0000); return; @@ -1995,9 +1999,6 @@ DialogMgr* dm = ( DialogMgr* ) core->GetInterface( IE_DLG_CLASS_ID ); dm->Open( core->GetResourceMgr()->GetResource( dlgref, IE_DLG_CLASS_ID ), true ); - if (dlg) { - delete dlg; - } dlg = dm->GetDialog(); core->FreeInterface( dm ); @@ -2228,8 +2229,20 @@ ieResRef tmpresref; strnlwrcpy(tmpresref,tr->Dialog, 8); InitDialog( speaker, target, tmpresref ); + if (!dlg) { + // error was displayed by InitDialog + ta->SetMinRow( false ); + EndDialog(); + return; + } } ds = dlg->GetState( si ); + if (!ds) { + printMessage("Dialog","Can't find next dialog\n",YELLOW); + ta->SetMinRow( false ); + EndDialog(); + return; + } } //displaying npc text core->DisplayStringName( ds->StrRef, 0x70FF70, target, IE_STR_SOUND|IE_STR_SPEECH); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ze...@us...> - 2009-03-08 18:34:43
|
Revision: 5776 http://gemrb.svn.sourceforge.net/gemrb/?rev=5776&view=rev Author: zefklop Date: 2009-03-08 18:34:29 +0000 (Sun, 08 Mar 2009) Log Message: ----------- Do not forget to reset target mode when handling containers or doors. This should finally fix bug 2533514 Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-03-08 17:52:39 UTC (rev 5775) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-03-08 18:34:29 UTC (rev 5776) @@ -1297,16 +1297,19 @@ if ((target_mode == TARGET_MODE_CAST) && spellCount) { //we'll get the container back from the coordinates TryToCast(actor, container->Pos); + //Do not reset target_mode, TryToCast does it for us!! return; } if (target_mode == TARGET_MODE_ATTACK) { TryToBash(actor, container); + target_mode = TARGET_MODE_NONE ; return; } if ((target_mode == TARGET_MODE_PICK)) { TryToPick(actor, container); + target_mode = TARGET_MODE_NONE; return; } @@ -1329,11 +1332,13 @@ if (target_mode == TARGET_MODE_ATTACK) { TryToBash(actor, door); + target_mode = TARGET_MODE_NONE ; return; } if ( (target_mode == TARGET_MODE_PICK) || door->TrapDetected) { TryToPick(actor, door); + target_mode = TARGET_MODE_NONE ; return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2009-03-11 22:18:35
|
Revision: 5787 http://gemrb.svn.sourceforge.net/gemrb/?rev=5787&view=rev Author: avenger_teambg Date: 2009-03-11 22:18:27 +0000 (Wed, 11 Mar 2009) Log Message: ----------- fix an uninitialised value Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-03-11 21:56:05 UTC (rev 5786) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-03-11 22:18:27 UTC (rev 5787) @@ -118,6 +118,7 @@ ieDword tmp=0; target_mode = TARGET_MODE_NONE; + target_types = 0; core->GetDictionary()->Lookup("Center",tmp); if (tmp) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2009-03-28 13:43:56
|
Revision: 5831 http://gemrb.svn.sourceforge.net/gemrb/?rev=5831&view=rev Author: avenger_teambg Date: 2009-03-28 13:43:01 +0000 (Sat, 28 Mar 2009) Log Message: ----------- lowered infopoint priority (fixes bug #1904892) Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-03-28 13:26:17 UTC (rev 5830) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-03-28 13:43:01 UTC (rev 5831) @@ -371,7 +371,7 @@ if (overDoor == d) { if (targetting) { if (d->VisibleTrap(0) || (d->Flags & DOOR_LOCKED)) { - // only highlight targettable doors + // only highlight targettable doors d->outlineColor = green; d->Highlight = true; continue; @@ -1496,15 +1496,15 @@ HandleDoor(overDoor, core->GetFirstSelectedPC(false)); return; } + if (overContainer) { + HandleContainer(overContainer, core->GetFirstSelectedPC(false)); + return; + } if (overInfoPoint) { if (HandleActiveRegion(overInfoPoint, core->GetFirstSelectedPC(false), p)) { return; } } - if (overContainer) { - HandleContainer(overContainer, core->GetFirstSelectedPC(false)); - return; - } //just a single actor, no formation if (game->selected.size()==1) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ze...@us...> - 2009-03-29 17:14:06
|
Revision: 5837 http://gemrb.svn.sourceforge.net/gemrb/?rev=5837&view=rev Author: zefklop Date: 2009-03-29 17:13:40 +0000 (Sun, 29 Mar 2009) Log Message: ----------- Slightly improve moving in formation. Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-03-29 16:02:20 UTC (rev 5836) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-03-29 17:13:40 UTC (rev 5837) @@ -172,6 +172,7 @@ void GameControl::MoveToPointFormation(Actor *actor, unsigned int pos, Point src, Point p) { char Tmp[256]; + Map* map = actor->GetCurrentArea() ; int formation=core->GetGame()->GetFormation(); if (pos>=FORMATIONSIZE) pos=FORMATIONSIZE-1; @@ -197,8 +198,17 @@ p.x += (int)newx; p.y += (int)newy; + p.x/=16; + p.y/=12; + + if (p.x < 0) p.x = 0; + if (p.y < 0) p.y = 0; + if (p.x > map->GetWidth()) p.x = map->GetWidth(); + if (p.y > map->GetHeight()) p.y = map->GetHeight(); + + map->AdjustPosition(p) ; // generate an action to do the actual movement - sprintf( Tmp, "MoveToPoint([%d.%d])", p.x, p.y ); + sprintf( Tmp, "MoveToPoint([%d.%d])", p.x*16, p.y*12 ); actor->AddAction( GenerateAction( Tmp) ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ze...@us...> - 2009-03-29 17:36:04
|
Revision: 5838 http://gemrb.svn.sourceforge.net/gemrb/?rev=5838&view=rev Author: zefklop Date: 2009-03-29 17:36:00 +0000 (Sun, 29 Mar 2009) Log Message: ----------- Do not adjust position if there is no need to do so... Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-03-29 17:13:40 UTC (rev 5837) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-03-29 17:36:00 UTC (rev 5838) @@ -198,17 +198,21 @@ p.x += (int)newx; p.y += (int)newy; - p.x/=16; - p.y/=12; + if (p.x < 0) p.x = 8; + if (p.y < 0) p.y = 8; + if (p.x > map->GetWidth()*16) p.x = map->GetWidth()*16 - 8; + if (p.y > map->GetHeight()*12) p.y = map->GetHeight()*12 - 8; - if (p.x < 0) p.x = 0; - if (p.y < 0) p.y = 0; - if (p.x > map->GetWidth()) p.x = map->GetWidth(); - if (p.y > map->GetHeight()) p.y = map->GetHeight(); - - map->AdjustPosition(p) ; + if(map->GetCursor(p) == IE_CURSOR_BLOCKED) { + //we can't get there --> adjust position + p.x/=16; + p.y/=12; + map->AdjustPosition(p); + p.x*=16; + p.y*=12; + } // generate an action to do the actual movement - sprintf( Tmp, "MoveToPoint([%d.%d])", p.x*16, p.y*12 ); + sprintf( Tmp, "MoveToPoint([%d.%d])", p.x, p.y ); actor->AddAction( GenerateAction( Tmp) ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2009-04-05 10:05:52
|
Revision: 5853 http://gemrb.svn.sourceforge.net/gemrb/?rev=5853&view=rev Author: avenger_teambg Date: 2009-04-05 10:05:34 +0000 (Sun, 05 Apr 2009) Log Message: ----------- fixed selection of actor Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-04-05 09:43:30 UTC (rev 5852) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-04-05 10:05:34 UTC (rev 5853) @@ -594,11 +594,14 @@ return; } +printf("Selecting: %d\n", whom); /* doesn't fall through here */ Actor* actor = game->FindPC( whom ); if (!actor) return; +printf("It is: %s\n", actor->ShortName); + if (type==0) { game->SelectActor( actor, false, SELECT_NORMAL ); return; @@ -1621,10 +1624,7 @@ switch (type) { case ACT_NONE: //none - //clicked on a new party member - // FIXME: call GameControl::SelectActor() instead - //game->SelectActor( actor, true, SELECT_REPLACE ); - SelectActor( game->InParty(actor) ); + SelectActor( actor->InParty ); break; case ACT_TALK: //talk (first selected talks) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-05-15 20:18:15
|
Revision: 5978 http://gemrb.svn.sourceforge.net/gemrb/?rev=5978&view=rev Author: fuzzie Date: 2009-05-15 20:17:56 +0000 (Fri, 15 May 2009) Log Message: ----------- allow (dysfunctional) disarming of proximity traps Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-05-15 19:21:14 UTC (rev 5977) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-05-15 20:17:56 UTC (rev 5978) @@ -1440,6 +1440,12 @@ //don't bother with this region further return true; } + if ((target_mode == TARGET_MODE_PICK)) { + TryToDisarm(actor, trap); + target_mode = TARGET_MODE_NONE; + return true; + } + switch(trap->Type) { case ST_TRAVEL: trap->Flags|=TRAP_RESET; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-05-16 15:42:27
|
Revision: 5982 http://gemrb.svn.sourceforge.net/gemrb/?rev=5982&view=rev Author: fuzzie Date: 2009-05-16 15:42:17 +0000 (Sat, 16 May 2009) Log Message: ----------- fix highlight/cursor for infopoint traps Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-05-16 10:32:02 UTC (rev 5981) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-05-16 15:42:17 UTC (rev 5982) @@ -374,6 +374,13 @@ unsigned int idx; for (idx = 0; (i = area->TMap->GetInfoPoint( idx )); idx++) { i->Highlight = false; + if (overInfoPoint == i && target_mode) { + if (i->VisibleTrap(0)) { + i->outlineColor = green; + i->Highlight = true; + continue; + } + } if (i->VisibleTrap(DebugFlags & DEBUG_SHOW_INFOPOINTS)) { i->outlineColor = red; // traps } else if (DebugFlags & DEBUG_SHOW_INFOPOINTS) { @@ -921,6 +928,10 @@ return IE_CURSOR_STEALTH|IE_CURSOR_GRAY; } + // traps always display a walk cursor? + if (overInfoPoint->Type == ST_PROXIMITY) { + return IE_CURSOR_WALK; + } return overInfoPoint->Cursor; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-05-16 19:05:55
|
Revision: 5984 http://gemrb.svn.sourceforge.net/gemrb/?rev=5984&view=rev Author: fuzzie Date: 2009-05-16 19:05:46 +0000 (Sat, 16 May 2009) Log Message: ----------- call ClearActions on InitDialog target Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-05-16 18:21:09 UTC (rev 5983) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-05-16 19:05:46 UTC (rev 5984) @@ -2146,6 +2146,7 @@ if (tgt->Type==ST_ACTOR) { Actor *tar = (Actor *) tgt; tar->DialogInterrupt(); + tar->ClearActions(); } //allow mouse selection from dialog (even though screen is locked) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-05-16 19:26:08
|
Revision: 5985 http://gemrb.svn.sourceforge.net/gemrb/?rev=5985&view=rev Author: fuzzie Date: 2009-05-16 19:25:58 +0000 (Sat, 16 May 2009) Log Message: ----------- okay, that broke at least cutscenes, bad idea :) Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-05-16 19:05:46 UTC (rev 5984) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-05-16 19:25:58 UTC (rev 5985) @@ -2146,7 +2146,6 @@ if (tgt->Type==ST_ACTOR) { Actor *tar = (Actor *) tgt; tar->DialogInterrupt(); - tar->ClearActions(); } //allow mouse selection from dialog (even though screen is locked) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-05-16 20:32:45
|
Revision: 5986 http://gemrb.svn.sourceforge.net/gemrb/?rev=5986&view=rev Author: fuzzie Date: 2009-05-16 20:32:37 +0000 (Sat, 16 May 2009) Log Message: ----------- okay, second try: execute dialog actions immediately via ExecuteAction Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-05-16 19:25:58 UTC (rev 5985) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-05-16 20:32:37 UTC (rev 5986) @@ -2294,7 +2294,7 @@ for (unsigned int i = 0; i < tr->action->count; i++) { Action* action = GenerateAction( tr->action->strings[i]); if (action) { - target->AddAction( action ); + GameScript::ExecuteAction( target, action ); } else { snprintf(Tmp, sizeof(Tmp), "Can't compile action: %s\n", @@ -2311,11 +2311,11 @@ } // moved immediate execution of dialog actions here - if (DialogueFlags & DF_FREEZE_SCRIPTS) { + /*if (DialogueFlags & DF_FREEZE_SCRIPTS) { target->ProcessActions(true); //clear queued actions that remained stacked? target->ClearActions(); - } + }*/ //displaying dialog for selected option int si = tr->stateIndex; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-05-16 21:07:30
|
Revision: 5988 http://gemrb.svn.sourceforge.net/gemrb/?rev=5988&view=rev Author: fuzzie Date: 2009-05-16 21:07:22 +0000 (Sat, 16 May 2009) Log Message: ----------- for now, queue end-of-dialog actions, due to complications Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-05-16 20:32:38 UTC (rev 5987) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-05-16 21:07:22 UTC (rev 5988) @@ -2294,7 +2294,14 @@ for (unsigned int i = 0; i < tr->action->count; i++) { Action* action = GenerateAction( tr->action->strings[i]); if (action) { - GameScript::ExecuteAction( target, action ); + // execute actions immediately if we're + // in the middle of a dialog (at the + // end there are complications, might + // try to initiate a new dialog) + if (tr->Flags & IE_DLG_TR_FINAL) + target->AddAction( action ); + else + GameScript::ExecuteAction( target, action ); } else { snprintf(Tmp, sizeof(Tmp), "Can't compile action: %s\n", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-06-10 20:51:30
|
Revision: 6391 http://gemrb.svn.sourceforge.net/gemrb/?rev=6391&view=rev Author: fuzzie Date: 2009-06-10 20:51:23 +0000 (Wed, 10 Jun 2009) Log Message: ----------- don't position tooltips above actors Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-06-10 20:08:59 UTC (rev 6390) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-06-10 20:51:23 UTC (rev 6391) @@ -1006,8 +1006,7 @@ Point p = actor->Pos; core->GetVideoDriver()->ConvertToScreen( p.x, p.y ); p.x += Owner->XPos + XPos; - // try positioning above (see also ActorBlock::DrawOverheadText) - p.y += Owner->YPos + YPos - actor->size*50; + p.y += Owner->YPos + YPos; // we should probably cope better with moving actors SetTooltip(buffer); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-06-10 22:48:21
|
Revision: 6393 http://gemrb.svn.sourceforge.net/gemrb/?rev=6393&view=rev Author: fuzzie Date: 2009-06-10 22:47:04 +0000 (Wed, 10 Jun 2009) Log Message: ----------- add actor tooltip positioning hack for PS:T Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-06-10 22:36:53 UTC (rev 6392) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-06-10 22:47:04 UTC (rev 6393) @@ -1008,6 +1008,9 @@ p.x += Owner->XPos + XPos; p.y += Owner->YPos + YPos; + // hack to position text above PS:T actors + if (!core->TooltipBack) p.y -= actor->size*50; + // we should probably cope better with moving actors SetTooltip(buffer); core->DisplayTooltip(p.x, p.y, this); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-06-15 13:04:32
|
Revision: 6447 http://gemrb.svn.sourceforge.net/gemrb/?rev=6447&view=rev Author: fuzzie Date: 2009-06-15 13:04:24 +0000 (Mon, 15 Jun 2009) Log Message: ----------- always use first party member for region travel Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-06-15 11:06:19 UTC (rev 6446) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-06-15 13:04:24 UTC (rev 6447) @@ -1776,9 +1776,9 @@ } //p is a searchmap travel region - if ( actor->GetCurrentArea()->GetCursor(p) == IE_CURSOR_TRAVEL) { + if ( party[0]->GetCurrentArea()->GetCursor(p) == IE_CURSOR_TRAVEL) { sprintf( Tmp, "NIDSpecial2()" ); - actor->AddAction( GenerateAction( Tmp) ); + party[0]->AddAction( GenerateAction( Tmp) ); } return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-06-15 14:02:51
|
Revision: 6448 http://gemrb.svn.sourceforge.net/gemrb/?rev=6448&view=rev Author: fuzzie Date: 2009-06-15 13:54:44 +0000 (Mon, 15 Jun 2009) Log Message: ----------- don't display tooltips for dead actors Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-06-15 13:04:24 UTC (rev 6447) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-06-15 13:54:44 UTC (rev 6448) @@ -945,6 +945,14 @@ Map* area = game->GetCurrentArea( ); if (area) { Actor *actor = area->GetActorByGlobalID(lastActorID); + if (actor && (actor->GetStat(IE_STATE_ID)&STATE_DEAD || actor->GetInternalFlag()&IF_JUSTDIED)) { + // checking IF_JUSTDIED is kind of horrid, but seems necessary + // no tooltips for dead actors! + actor->SetOver( false ); + lastActorID = 0; + actor = NULL; + } + if (actor) { char *name = actor->GetName(1); int hp = actor->GetStat(IE_HITPOINTS); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lyn...@us...> - 2009-06-16 15:31:12
|
Revision: 6473 http://gemrb.svn.sourceforge.net/gemrb/?rev=6473&view=rev Author: lynxlupodian Date: 2009-06-16 15:29:18 +0000 (Tue, 16 Jun 2009) Log Message: ----------- made ESC reset the action bar Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-06-15 22:11:13 UTC (rev 6472) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-06-16 15:29:18 UTC (rev 6473) @@ -1922,6 +1922,10 @@ moveX = 0; moveY = 0; return; + case GEM_ESCAPE: + core->GetGUIScriptEngine()->RunFunction("EmptyControls"); + core->SetEventFlag(EF_ACTION); + return; default: return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-06-17 12:55:47
|
Revision: 6502 http://gemrb.svn.sourceforge.net/gemrb/?rev=6502&view=rev Author: fuzzie Date: 2009-06-17 12:28:47 +0000 (Wed, 17 Jun 2009) Log Message: ----------- process user-initiated MoveToPoint actions immediately so we get recticles when paused Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-06-17 12:17:50 UTC (rev 6501) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-06-17 12:28:47 UTC (rev 6502) @@ -246,6 +246,8 @@ } actor->AddAction( action ); + // force action so that we get target recticles immediately + actor->ProcessActions(true); } GameControl::~GameControl(void) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |