♻️ Change 'SetMapMonsters' to take a 'Point' instead of 2 separate ints
This commit is contained in:
parent
944ff6fb78
commit
0d4e792551
6 changed files with 17 additions and 17 deletions
|
|
@ -1246,7 +1246,7 @@ void LoadL1Dungeon(const char *path, int vx, int vy)
|
|||
if (currlevel < 17)
|
||||
DRLG_InitL1Vals();
|
||||
|
||||
SetMapMonsters(dunData.get(), 0, 0);
|
||||
SetMapMonsters(dunData.get(), { 0, 0 });
|
||||
SetMapObjects(dunData.get(), 0, 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3308,7 +3308,7 @@ void LoadL2Dungeon(const char *path, int vx, int vy)
|
|||
ViewX = vx;
|
||||
ViewY = vy;
|
||||
|
||||
SetMapMonsters(dunData.get(), 0, 0);
|
||||
SetMapMonsters(dunData.get(), { 0, 0 });
|
||||
SetMapObjects(dunData.get(), 0, 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2657,7 +2657,7 @@ void LoadL3Dungeon(const char *path, int vx, int vy)
|
|||
ViewX = vx;
|
||||
ViewY = vy;
|
||||
|
||||
SetMapMonsters(dunData.get(), 0, 0);
|
||||
SetMapMonsters(dunData.get(), { 0, 0 });
|
||||
SetMapObjects(dunData.get(), 0, 0);
|
||||
|
||||
for (int j = 0; j < MAXDUNY; j++) {
|
||||
|
|
|
|||
|
|
@ -1758,7 +1758,7 @@ void LoadL4Dungeon(const char *path, int vx, int vy)
|
|||
DRLG_L4Pass3();
|
||||
DRLG_Init_Globals();
|
||||
|
||||
SetMapMonsters(dunData.get(), 0, 0);
|
||||
SetMapMonsters(dunData.get(), { 0, 0 });
|
||||
SetMapObjects(dunData.get(), 0, 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -946,23 +946,23 @@ void PlaceQuestMonsters()
|
|||
|
||||
if (QuestStatus(Q_LTBANNER)) {
|
||||
auto dunData = LoadFileInMem<uint16_t>("Levels\\L1Data\\Banner1.DUN");
|
||||
SetMapMonsters(dunData.get(), 2 * setpc_x, 2 * setpc_y);
|
||||
SetMapMonsters(dunData.get(), Point { setpc_x, setpc_y } * 2);
|
||||
}
|
||||
if (QuestStatus(Q_BLOOD)) {
|
||||
auto dunData = LoadFileInMem<uint16_t>("Levels\\L2Data\\Blood2.DUN");
|
||||
SetMapMonsters(dunData.get(), 2 * setpc_x, 2 * setpc_y);
|
||||
SetMapMonsters(dunData.get(), Point { setpc_x, setpc_y } * 2);
|
||||
}
|
||||
if (QuestStatus(Q_BLIND)) {
|
||||
auto dunData = LoadFileInMem<uint16_t>("Levels\\L2Data\\Blind2.DUN");
|
||||
SetMapMonsters(dunData.get(), 2 * setpc_x, 2 * setpc_y);
|
||||
SetMapMonsters(dunData.get(), Point { setpc_x, setpc_y } * 2);
|
||||
}
|
||||
if (QuestStatus(Q_ANVIL)) {
|
||||
auto dunData = LoadFileInMem<uint16_t>("Levels\\L3Data\\Anvil.DUN");
|
||||
SetMapMonsters(dunData.get(), 2 * setpc_x + 2, 2 * setpc_y + 2);
|
||||
SetMapMonsters(dunData.get(), Point { setpc_x + 2, setpc_y + 2 } * 2);
|
||||
}
|
||||
if (QuestStatus(Q_WARLORD)) {
|
||||
auto dunData = LoadFileInMem<uint16_t>("Levels\\L4Data\\Warlord.DUN");
|
||||
SetMapMonsters(dunData.get(), 2 * setpc_x, 2 * setpc_y);
|
||||
SetMapMonsters(dunData.get(), Point { setpc_x, setpc_y } * 2);
|
||||
AddMonsterType(UniqMonst[UMT_WARLORD].mtype, PLACE_SCATTER);
|
||||
}
|
||||
if (QuestStatus(Q_VEIL)) {
|
||||
|
|
@ -979,7 +979,7 @@ void PlaceQuestMonsters()
|
|||
PlaceUniqueMonst(UMT_RED_VEX, 0, 0);
|
||||
PlaceUniqueMonst(UMT_BLACKJADE, 0, 0);
|
||||
auto dunData = LoadFileInMem<uint16_t>("Levels\\L4Data\\Vile1.DUN");
|
||||
SetMapMonsters(dunData.get(), 2 * setpc_x, 2 * setpc_y);
|
||||
SetMapMonsters(dunData.get(), Point { setpc_x, setpc_y } * 2);
|
||||
}
|
||||
|
||||
if (currlevel == 24) {
|
||||
|
|
@ -1083,19 +1083,19 @@ void LoadDiabMonsts()
|
|||
{
|
||||
{
|
||||
auto dunData = LoadFileInMem<uint16_t>("Levels\\L4Data\\diab1.DUN");
|
||||
SetMapMonsters(dunData.get(), 2 * diabquad1x, 2 * diabquad1y);
|
||||
SetMapMonsters(dunData.get(), Point { diabquad1x, diabquad1y } * 2);
|
||||
}
|
||||
{
|
||||
auto dunData = LoadFileInMem<uint16_t>("Levels\\L4Data\\diab2a.DUN");
|
||||
SetMapMonsters(dunData.get(), 2 * diabquad2x, 2 * diabquad2y);
|
||||
SetMapMonsters(dunData.get(), Point { diabquad2x, diabquad2y } * 2);
|
||||
}
|
||||
{
|
||||
auto dunData = LoadFileInMem<uint16_t>("Levels\\L4Data\\diab3a.DUN");
|
||||
SetMapMonsters(dunData.get(), 2 * diabquad3x, 2 * diabquad3y);
|
||||
SetMapMonsters(dunData.get(), Point { diabquad3x, diabquad3y } * 2);
|
||||
}
|
||||
{
|
||||
auto dunData = LoadFileInMem<uint16_t>("Levels\\L4Data\\diab4a.DUN");
|
||||
SetMapMonsters(dunData.get(), 2 * diabquad4x, 2 * diabquad4y);
|
||||
SetMapMonsters(dunData.get(), Point { diabquad4x, diabquad4y } * 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1175,7 +1175,7 @@ void InitMonsters()
|
|||
}
|
||||
}
|
||||
|
||||
void SetMapMonsters(const uint16_t *dunData, int startx, int starty)
|
||||
void SetMapMonsters(const uint16_t *dunData, Point startPosition)
|
||||
{
|
||||
AddMonsterType(MT_GOLEM, PLACE_SPECIAL);
|
||||
AddMonster(1, 0, DIR_S, 0, false);
|
||||
|
|
@ -1207,7 +1207,7 @@ void SetMapMonsters(const uint16_t *dunData, int startx, int starty)
|
|||
uint8_t monsterId = SDL_SwapLE16(monsterLayer[j * width + i]);
|
||||
if (monsterId != 0) {
|
||||
int mtype = AddMonsterType(MonstConvTbl[monsterId - 1], PLACE_SPECIAL);
|
||||
PlaceMonster(nummonsters++, mtype, i + startx + 16, j + starty + 16);
|
||||
PlaceMonster(nummonsters++, mtype, i + startPosition.x + 16, j + startPosition.y + 16);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ void ClrAllMonsters();
|
|||
void monster_some_crypt();
|
||||
void PlaceGroup(int mtype, int num, int leaderf, int leader);
|
||||
void InitMonsters();
|
||||
void SetMapMonsters(const uint16_t *dunData, int startx, int starty);
|
||||
void SetMapMonsters(const uint16_t *dunData, Point startPosition);
|
||||
void DeleteMonster(int i);
|
||||
int AddMonster(int x, int y, Direction dir, int mtype, bool InMap);
|
||||
void monster_43C785(int i);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue