aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBendegúz Nagy2016-08-26 22:09:29 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commitcfebcea041d9fd123e06a01d1ddaf87b6e246bc0 (patch)
treec5a14e6a6d13502187f8a4757e4891ff560c45b6
parent61500b3dc8253df3c62fada6ee6e5f297d67b33e (diff)
downloadscummvm-rg350-cfebcea041d9fd123e06a01d1ddaf87b6e246bc0.tar.gz
scummvm-rg350-cfebcea041d9fd123e06a01d1ddaf87b6e246bc0.tar.bz2
scummvm-rg350-cfebcea041d9fd123e06a01d1ddaf87b6e246bc0.zip
DM: Add dummy test code for chmpion selection
-rw-r--r--engines/dm/champion.cpp8
-rw-r--r--engines/dm/dm.cpp9
-rw-r--r--engines/dm/dm.h4
-rw-r--r--engines/dm/dungeonman.cpp8
-rw-r--r--engines/dm/eventman.cpp15
5 files changed, 32 insertions, 12 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index f93a9aa405..6518ee9eeb 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -48,7 +48,7 @@ uint16 gSlotMasks[38] = { // @ G0038_ai_Graphic562_SlotMasks
0x0400, /* Chest 7 Chest */
0x0400}; /* Chest 8 Chest */
-Box gBoxChampionPortrait = {0, 31, 0, 28}; // @ G0047_s_Graphic562_Box_ChampionPortrait
+Box gBoxChampionPortrait = Box(0, 31, 0, 28); // @ G0047_s_Graphic562_Box_ChampionPortrait
ChampionMan::ChampionMan(DMEngine *vm) : _vm(vm) {
_leaderIndex = kChampionNone;
@@ -81,7 +81,7 @@ ChampionIndex ChampionMan::getIndexInCell(ViewCell cell) {
void ChampionMan::resetDataToStartGame() {
if (!_vm->_dungeonMan->_messages._newGame) {
- warning("MISSING CODE: stuff for reeseting for loaded games");
+ warning("MISSING CODE: stuff for resetting for loaded games");
assert(false);
}
@@ -202,8 +202,8 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
int16 mapY = _vm->_dungeonMan->_currMap._partyPosY;
uint16 championObjectsCell = returnOppositeDir((direction)(dunMan._currMap._partyDir));
- mapX += dirIntoStepCountEast[dunMan._currMap._partyDir];
- mapY += dirIntoStepCountNorth[dunMan._currMap._partyDir];
+ mapX += gDirIntoStepCountEast[dunMan._currMap._partyDir];
+ mapY += gDirIntoStepCountNorth[dunMan._currMap._partyDir];
thing = dunMan.getSquareFirstThing(mapX, mapY);
AL_0_slotIndex_Red = kChampionSlotBackpackLine_1_1;
uint16 slotIndex_Green;
diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp
index 860fba2af6..6d9b503399 100644
--- a/engines/dm/dm.cpp
+++ b/engines/dm/dm.cpp
@@ -23,8 +23,8 @@
namespace DM {
-int8 dirIntoStepCountEast[4] = {0 /* North */, 1 /* East */, 0 /* West */, -1 /* South */}; // @ G0233_ai_Graphic559_DirectionToStepEastCount
-int8 dirIntoStepCountNorth[4] = {-1 /* North */, 0 /* East */, 1 /* West */, 0 /* South */}; // @ G0234_ai_Graphic559_DirectionToStepNorthCount
+int8 gDirIntoStepCountEast[4] = {0 /* North */, 1 /* East */, 0 /* West */, -1 /* South */}; // @ G0233_ai_Graphic559_DirectionToStepEastCount
+int8 gDirIntoStepCountNorth[4] = {-1 /* North */, 0 /* East */, 1 /* West */, 0 /* South */}; // @ G0234_ai_Graphic559_DirectionToStepNorthCount
void turnDirRight(direction &dir) { dir = (direction)((dir + 1) & 3); }
void turnDirLeft(direction &dir) { dir = (direction)((dir - 1) & 3); }
@@ -163,6 +163,11 @@ Common::Error DMEngine::run() {
}
void DMEngine::gameloop() {
+ warning("DUMMY CODE SETTING PARTY POS AND DIRECTION");
+ _dungeonMan->_currMap._partyPosX = 10;
+ _dungeonMan->_currMap._partyPosY = 4;
+ _dungeonMan->_currMap._partyDir = kDirNorth;
+
while (true) {
_stopWaitingForPlayerInput = false;
//do {
diff --git a/engines/dm/dm.h b/engines/dm/dm.h
index 61cb92c2c0..d9cecaa2ab 100644
--- a/engines/dm/dm.h
+++ b/engines/dm/dm.h
@@ -27,8 +27,8 @@ enum direction {
};
// TODO: refactor direction into a class
-extern int8 dirIntoStepCountEast[4];
-extern int8 dirIntoStepCountNorth[4];
+extern int8 gDirIntoStepCountEast[4];
+extern int8 gDirIntoStepCountNorth[4];
void turnDirRight(direction &dir);
void turnDirLeft(direction &dir);
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp
index 1ac9e850be..f489c53d2f 100644
--- a/engines/dm/dungeonman.cpp
+++ b/engines/dm/dungeonman.cpp
@@ -391,11 +391,11 @@ int16 DM::indexToOrdinal(int16 val) { return val + 1; }
void DungeonMan::mapCoordsAfterRelMovement(direction dir, int16 stepsForward, int16 stepsRight, int16 &posX, int16 &posY) {
- posX += dirIntoStepCountEast[dir] * stepsForward;
- posY += dirIntoStepCountNorth[dir] * stepsForward;
+ posX += gDirIntoStepCountEast[dir] * stepsForward;
+ posY += gDirIntoStepCountNorth[dir] * stepsForward;
turnDirRight(dir);
- posX += dirIntoStepCountEast[dir] * stepsRight;
- posY += dirIntoStepCountNorth[dir] * stepsRight;
+ posX += gDirIntoStepCountEast[dir] * stepsRight;
+ posY += gDirIntoStepCountNorth[dir] * stepsRight;
}
DungeonMan::DungeonMan(DMEngine *dmEngine) : _vm(dmEngine), _rawDunFileData(NULL), _maps(NULL), _rawMapData(NULL) {
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index 6d76ddb960..a7a330366d 100644
--- a/engines/dm/eventman.cpp
+++ b/engines/dm/eventman.cpp
@@ -372,6 +372,21 @@ void EventManager::processCommandQueue() {
if ((cmd._type >= kCommandMoveForward) && (cmd._type <= kCommandMoveLeft)) {
commandMoveParty(cmd._type);
return;
+ }
+
+ if (cmd._type == kCommandClickInDungeonView) {
+ warning("DUMMY CODE, all of this");
+ DungeonMan &dunMan = *_vm->_dungeonMan;
+ CurrMapData &currMap = dunMan._currMap;
+ uint16 mapX = currMap._partyPosX;
+ uint16 mapY = currMap._partyPosY;
+ mapX += gDirIntoStepCountEast[currMap._partyDir];
+ mapY += gDirIntoStepCountNorth[currMap._partyDir];
+ Thing squareFirstThing = dunMan.getSquareFirstThing(mapX, mapY);
+ Sensor sensor(dunMan.getThingData(squareFirstThing));
+ if (sensor.getType() == kSensorWallChampionPortrait) {
+ _vm->_championMan->addCandidateChampionToParty(sensor.getData());
+ }
}
// MISSING CODE: the rest of the function