mirror of
https://github.com/diasurgical/DevilutionX.git
synced 2026-10-12 02:13:06 +00:00
Done with the following script:
```ruby
Dir["Source/**/*.{h,c,cc,cpp,hpp}"].each do |path|
v = File.read(path)
next if !v.include?("uint32_t") || v.include?("cstdint")
lines = v.lines
line_num = if lines[2].start_with?(" *")
lines.index { |l| l.start_with?(" */") } + 3
else
3
end
lines.insert(line_num, "#include <cstdint>\n")
File.write(path, lines.join(""))
end
```
then fixed-up manually
49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
/**
|
|
* @file loadsave.h
|
|
*
|
|
* Interface of save game functionality.
|
|
*/
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
|
|
#include "pfile.h"
|
|
#include "player.h"
|
|
#include "utils/attributes.h"
|
|
|
|
namespace devilution {
|
|
|
|
extern DVL_API_FOR_TEST bool gbIsHellfireSaveGame;
|
|
extern DVL_API_FOR_TEST uint8_t giNumberOfLevels;
|
|
|
|
void RemoveInvalidItem(Item &pItem);
|
|
_item_indexes RemapItemIdxFromDiablo(_item_indexes i);
|
|
_item_indexes RemapItemIdxToDiablo(_item_indexes i);
|
|
_item_indexes RemapItemIdxFromSpawn(_item_indexes i);
|
|
_item_indexes RemapItemIdxToSpawn(_item_indexes i);
|
|
bool IsHeaderValid(uint32_t magicNumber);
|
|
void LoadHotkeys();
|
|
void LoadHeroItems(Player &player);
|
|
/**
|
|
* @brief Remove invalid inventory items from the inventory grid
|
|
* @param player The player to remove invalid items from
|
|
*/
|
|
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(SaveWriter &saveWriter, const Player &player);
|
|
void SaveHeroItems(SaveWriter &saveWriter, Player &player);
|
|
void SaveGameData(SaveWriter &saveWriter);
|
|
void SaveGame();
|
|
void SaveLevel(SaveWriter &saveWriter);
|
|
void LoadLevel();
|
|
void ConvertLevels(SaveWriter &saveWriter);
|
|
void LoadStash();
|
|
void SaveStash(SaveWriter &stashWriter);
|
|
|
|
} // namespace devilution
|