Skip to content

Commit

Permalink
DM: Add F0147_DUNGEON_GetGroupDirections
Browse files Browse the repository at this point in the history
  • Loading branch information
Bendegúz Nagy committed Aug 26, 2016
1 parent 4f394fc commit cd7363f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion engines/dm/TODOs/methodtree.txt
Expand Up @@ -9,7 +9,7 @@ F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF
F0158_DUNGEON_GetWeaponInfo // done
M66_PROJECTILE_ASPECT_ORDINAL // done
F0176_GROUP_GetCreatureOrdinalInCell
F0145_DUNGEON_GetGroupCells
F0145_DUNGEON_GetGroupCells // done
F0147_DUNGEON_GetGroupDirections
GROUP // done
CreatureType
Expand Down
9 changes: 9 additions & 0 deletions engines/dm/group.cpp
Expand Up @@ -59,4 +59,13 @@ uint16 GroupMan::getGroupCells(Group* group, int16 mapIndex) {
cells = _activeGroups[cells]._cells;
return cells;
}

byte gGroupDirections[4] = {0x00, 0x55, 0xAA, 0xFF}; // @ G0258_auc_Graphic559_GroupDirections

uint16 GroupMan::getGroupDirections(Group* group, int16 mapIndex) {
if (mapIndex == _vm->_dungeonMan->_currMap._currPartyMapIndex)
return _activeGroups[group->getActiveGroupIndex()]._directions;

return gGroupDirections[group->getDir()];
}
}
3 changes: 2 additions & 1 deletion engines/dm/group.h
Expand Up @@ -36,7 +36,7 @@ namespace DM {
class ActiveGroup {
public:
int _groupThingIndex;
byte _directions;
direction _directions;
byte _cells;
byte _lastMoveTime;
byte _delayFleeingFromTarget;
Expand Down Expand Up @@ -86,6 +86,7 @@ class GroupMan {
~GroupMan();
void initActiveGroups(); // @ F0196_GROUP_InitializeActiveGroups
uint16 getGroupCells(Group *group, int16 mapIndex); // @ F0145_DUNGEON_GetGroupCells
uint16 getGroupDirections(Group *group, int16 mapIndex); // @ F0147_DUNGEON_GetGroupDirections
};


Expand Down

0 comments on commit cd7363f

Please sign in to comment.