Browse Source

Move documentation from implementations to declarations

pull/2867/head
Siddharth singh chouhan 5 years ago committed by GitHub
parent
commit
bcb332b7b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      Source/loadsave.cpp
  2. 5
      Source/loadsave.h
  3. 10
      Source/minitext.cpp
  4. 12
      Source/minitext.h
  5. 77
      Source/missiles.cpp
  6. 91
      Source/missiles.h

4
Source/loadsave.cpp

@ -1646,10 +1646,6 @@ void RemoveEmptyInventory(Player &player)
}
}
/**
* @brief Load game state
* @param firstflag Can be set to false if we are simply reloading the current game
*/
void LoadGame(bool firstflag)
{
FreeGameMem();

5
Source/loadsave.h

@ -25,6 +25,11 @@ void LoadHeroItems(Player &player);
* @param pnum The id of the player
*/
void RemoveEmptyInventory(Player &player);
/**
* @brief Load game state
* @param firstflag Can be set to false if we are simply reloading the current game
*/
void LoadGame(bool firstflag);
void SaveHotkeys();
void SaveHeroItems(Player &player);

10
Source/minitext.cpp

@ -123,27 +123,17 @@ void DrawQTextContent(const Surface &out)
} // namespace
/**
* @brief Free the resouces used by the quest dialog window
*/
void FreeQuestText()
{
pTextBoxCels = std::nullopt;
}
/**
* @brief Load the resouces used by the quest dialog window, and initialize it's state
*/
void InitQuestText()
{
pTextBoxCels = LoadCel("Data\\TextBox.CEL", 591);
qtextflag = false;
}
/**
* @brief Start the given naration
* @param m Index of narration from the Texts table
*/
void InitQTextMsg(_speech_id m)
{
if (Speeches[m].scrlltxt) {

12
Source/minitext.h

@ -12,8 +12,20 @@ namespace devilution {
extern bool qtextflag;
/**
* @brief Free the resouces used by the quest dialog window
*/
void FreeQuestText();
/**
* @brief Load the resouces used by the quest dialog window, and initialize it's state
*/
void InitQuestText();
/**
* @brief Start the given naration
* @param m Index of narration from the Texts table
*/
void InitQTextMsg(_speech_id m);
/**

77
Source/missiles.cpp

@ -990,25 +990,6 @@ int GetSpellLevel(int playerId, spell_id sn)
return std::max(player._pISplLvlAdd + player._pSplLvl[sn], 0);
}
/**
* @brief Returns the direction a vector from p1(x1, y1) to p2(x2, y2) is pointing to.
*
* W sW SW Sw S
* ^
* nW | Se
* |
* NW ------+-----> SE
* |
* Nw | sE
* |
* N Ne NE nE E
*
* @param x1 the x coordinate of p1
* @param y1 the y coordinate of p1
* @param x2 the x coordinate of p2
* @param y2 the y coordinate of p2
* @return the direction of the p1->p2 vector
*/
Direction16 GetDirection16(Point p1, Point p2)
{
Displacement offset = p2 - p1;
@ -1426,9 +1407,6 @@ void AddBerserk(Missile &missile, Point dst, Direction /*midir*/)
}
}
/**
* var1: Direction to place the spawn
*/
void AddHorkSpawn(Missile &missile, Point dst, Direction midir)
{
UpdateMissileVelocity(missile, dst, 8);
@ -2002,12 +1980,6 @@ void AddFirewall(Missile &missile, Point dst, Direction /*midir*/)
missile.var1 = missile._mirange - missile._miAnimLen;
}
/**
* var1: X coordinate of the missile-light
* var2: Y coordinate of the missile-light
* var4: X coordinate of the missile-light
* var5: Y coordinate of the missile-light
*/
void AddFireball(Missile &missile, Point dst, Direction midir)
{
if (missile.position.start == dst) {
@ -2030,10 +2002,6 @@ void AddFireball(Missile &missile, Point dst, Direction midir)
missile._mlid = AddLight(missile.position.start, 8);
}
/**
* var1: X coordinate of the missile
* var2: Y coordinate of the missile
*/
void AddLightctrl(Missile &missile, Point dst, Direction /*midir*/)
{
if (missile._midam == 0 && missile._micaster == TARGET_MONSTERS)
@ -2105,9 +2073,6 @@ void AddWeapexp(Missile &missile, Point dst, Direction /*midir*/)
missile._mirange = missile._miAnimLen - 1;
}
/**
* var1: Animation
*/
void AddTown(Missile &missile, Point dst, Direction /*midir*/)
{
Point target = dst;
@ -2218,10 +2183,6 @@ void AddFiremove(Missile &missile, Point dst, Direction /*midir*/)
missile.position.offset.deltaY -= 32;
}
/**
* var1: Animation
* var3: Light strength
*/
void AddGuardian(Missile &missile, Point dst, Direction /*midir*/)
{
auto &player = Players[missile._misource];
@ -2268,10 +2229,6 @@ void AddGuardian(Missile &missile, Point dst, Direction /*midir*/)
}
}
/**
* var1: X coordinate of the destination
* var2: Y coordinate of the destination
*/
void AddChain(Missile &missile, Point dst, Direction /*midir*/)
{
missile.var1 = dst.x;
@ -2323,10 +2280,6 @@ void AddRhino(Missile &missile, Point dst, Direction midir)
PutMissile(missile);
}
/**
* var1: X coordinate of the missile-light
* var2: Y coordinate of the missile-light
*/
void AddFlare(Missile &missile, Point dst, Direction midir)
{
if (missile.position.start == dst) {
@ -2357,10 +2310,6 @@ void AddFlare(Missile &missile, Point dst, Direction midir)
}
}
/**
* var1: X coordinate of the missile-light
* var2: Y coordinate of the missile-light
*/
void AddAcid(Missile &missile, Point dst, Direction /*midir*/)
{
UpdateMissileVelocity(missile, dst, 16);
@ -2383,10 +2332,6 @@ void AddAcidpud(Missile &missile, Point /*dst*/, Direction /*midir*/)
missile._miPreFlag = true;
}
/**
* var1: mmode of the monster
* var2: mnum of the monster
*/
void AddStone(Missile &missile, Point dst, Direction /*midir*/)
{
Point target;
@ -2522,12 +2467,6 @@ void AddHealOther(Missile &missile, Point /*dst*/, Direction /*midir*/)
}
}
/**
* var1: X coordinate of the missile-light
* var2: Y coordinate of the missile-light
* var4: X coordinate of the destination
* var5: Y coordinate of the destination
*/
void AddElement(Missile &missile, Point dst, Direction midir)
{
if (missile.position.start == dst) {
@ -2566,14 +2505,6 @@ void AddIdentify(Missile &missile, Point /*dst*/, Direction /*midir*/)
}
}
/**
* var1: X coordinate of the first wave
* var2: Y coordinate of the first wave
* var3: Direction of the first wave
* var4: Direction of the second wave
* var5: X coordinate of the second wave
* var6: Y coordinate of the second wave
*/
void AddFirewallC(Missile &missile, Point dst, Direction midir)
{
missile._miDelFlag = true;
@ -2616,10 +2547,6 @@ void AddInfra(Missile &missile, Point /*dst*/, Direction /*midir*/)
UseMana(missile._misource, SPL_INFRA);
}
/**
* var1: X coordinate of the destination
* var2: Y coordinate of the destination
*/
void AddWave(Missile &missile, Point dst, Direction /*midir*/)
{
missile.var1 = dst.x;
@ -2761,10 +2688,6 @@ void AddFlamec(Missile &missile, Point dst, Direction midir)
missile._mirange = 256;
}
/**
* var1: Light strength
* var2: Base direction
*/
void AddCbolt(Missile &missile, Point dst, Direction midir)
{
missile._mirnd = GenerateRnd(15) + 1;

91
Source/missiles.h

@ -143,6 +143,26 @@ extern bool MissilePreFlag;
void GetDamageAmt(int i, int *mind, int *maxd);
int GetSpellLevel(int playerId, spell_id sn);
/**
* @brief Returns the direction a vector from p1(x1, y1) to p2(x2, y2) is pointing to.
*
* W sW SW Sw S
* ^
* nW | Se
* |
* NW ------+-----> SE
* |
* Nw | sE
* |
* N Ne NE nE E
*
* @param x1 the x coordinate of p1
* @param y1 the y coordinate of p1
* @param x2 the x coordinate of p2
* @param y2 the y coordinate of p2
* @return the direction of the p1->p2 vector
*/
Direction16 GetDirection16(Point p1, Point p2);
void DeleteMissile(int i);
bool MonsterTrapHit(int m, int mindam, int maxdam, int dist, missile_id t, bool shift);
@ -184,6 +204,10 @@ void AddImmolationRune(Missile &missile, Point dst, Direction midir);
void AddStoneRune(Missile &missile, Point dst, Direction midir);
void AddReflection(Missile &missile, Point dst, Direction midir);
void AddBerserk(Missile &missile, Point dst, Direction midir);
/**
* var1: Direction to place the spawn
*/
void AddHorkSpawn(Missile &missile, Point dst, Direction midir);
void AddJester(Missile &missile, Point dst, Direction midir);
void AddStealPotions(Missile &missile, Point dst, Direction midir);
@ -207,31 +231,93 @@ void AddMagmaball(Missile &missile, Point dst, Direction midir);
void AddTeleport(Missile &missile, Point dst, Direction midir);
void AddLightball(Missile &missile, Point dst, Direction midir);
void AddFirewall(Missile &missile, Point dst, Direction midir);
/**
* var1: X coordinate of the missile-light
* var2: Y coordinate of the missile-light
* var4: X coordinate of the missile-light
* var5: Y coordinate of the missile-light
*/
void AddFireball(Missile &missile, Point dst, Direction midir);
/**
* var1: X coordinate of the missile
* var2: Y coordinate of the missile
*/
void AddLightctrl(Missile &missile, Point dst, Direction midir);
void AddLightning(Missile &missile, Point dst, Direction midir);
void AddMisexp(Missile &missile, Point dst, Direction midir);
void AddWeapexp(Missile &missile, Point dst, Direction midir);
/**
* var1: Animation
*/
void AddTown(Missile &missile, Point dst, Direction midir);
void AddFlash(Missile &missile, Point dst, Direction midir);
void AddFlash2(Missile &missile, Point dst, Direction midir);
void AddManashield(Missile &missile, Point dst, Direction midir);
void AddFiremove(Missile &missile, Point dst, Direction midir);
/**
* var1: Animation
* var3: Light strength
*/
void AddGuardian(Missile &missile, Point dst, Direction midir);
/**
* var1: X coordinate of the destination
* var2: Y coordinate of the destination
*/
void AddChain(Missile &missile, Point dst, Direction midir);
void AddRhino(Missile &missile, Point dst, Direction midir);
/**
* var1: X coordinate of the missile-light
* var2: Y coordinate of the missile-light
*/
void AddFlare(Missile &missile, Point dst, Direction midir);
/**
* var1: X coordinate of the missile-light
* var2: Y coordinate of the missile-light
*/
void AddAcid(Missile &missile, Point dst, Direction midir);
void AddAcidpud(Missile &missile, Point dst, Direction midir);
/**
* var1: mmode of the monster
* var2: mnum of the monster
*/
void AddStone(Missile &missile, Point dst, Direction midir);
void AddGolem(Missile &missile, Point dst, Direction midir);
void AddBoom(Missile &missile, Point dst, Direction midir);
void AddHeal(Missile &missile, Point dst, Direction midir);
void AddHealOther(Missile &missile, Point dst, Direction midir);
/**
* var1: X coordinate of the missile-light
* var2: Y coordinate of the missile-light
* var4: X coordinate of the destination
* var5: Y coordinate of the destination
*/
void AddElement(Missile &missile, Point dst, Direction midir);
void AddIdentify(Missile &missile, Point dst, Direction midir);
/**
* var1: X coordinate of the first wave
* var2: Y coordinate of the first wave
* var3: Direction of the first wave
* var4: Direction of the second wave
* var5: X coordinate of the second wave
* var6: Y coordinate of the second wave
*/
void AddFirewallC(Missile &missile, Point dst, Direction midir);
void AddInfra(Missile &missile, Point dst, Direction midir);
/**
* var1: X coordinate of the destination
* var2: Y coordinate of the destination
*/
void AddWave(Missile &missile, Point dst, Direction midir);
void AddNova(Missile &missile, Point dst, Direction midir);
void AddBlodboil(Missile &missile, Point dst, Direction midir);
@ -241,6 +327,11 @@ void AddDisarm(Missile &missile, Point dst, Direction midir);
void AddApoca(Missile &missile, Point dst, Direction midir);
void AddFlame(Missile &missile, Point dst, Direction midir);
void AddFlamec(Missile &missile, Point dst, Direction midir);
/**
* var1: Light strength
* var2: Base direction
*/
void AddCbolt(Missile &missile, Point dst, Direction midir);
void AddHbolt(Missile &missile, Point dst, Direction midir);
void AddResurrect(Missile &missile, Point dst, Direction midir);

Loading…
Cancel
Save