Rename BlocDb to SavegameDb

This commit is contained in:
King_DuckZ 2025-02-15 17:26:34 +00:00
parent 8c83c32b3d
commit 829ad425aa
4 changed files with 12 additions and 12 deletions

View file

@ -17,7 +17,7 @@
#pragma once #pragma once
#include "block_db.hpp" #include "savegame_db.hpp"
#include <QMainWindow> #include <QMainWindow>
#include <QStringList> #include <QStringList>
#include <list> #include <list>
@ -50,7 +50,7 @@ private:
void open_file_from_dialog(); void open_file_from_dialog();
void load_memory_cards (const QStringList& paths); void load_memory_cards (const QStringList& paths);
duck::BlockDb m_block_db; duck::SavegameDb m_block_db;
std::list<mc::psx::MemoryCard> m_memcards; std::list<mc::psx::MemoryCard> m_memcards;
QGridLayout* m_main_lay; QGridLayout* m_main_lay;
widget::BlockGrid* m_lower_grid; widget::BlockGrid* m_lower_grid;

View file

@ -38,7 +38,7 @@ executable(app_name,
'widgets/detail/block_drag_and_drop.cpp', 'widgets/detail/block_drag_and_drop.cpp',
'make_qt_animation.cpp', 'make_qt_animation.cpp',
'animated_pixmap.cpp', 'animated_pixmap.cpp',
'block_db.cpp', 'savegame_db.cpp',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
qt6_dep, qt6_dep,

View file

@ -15,7 +15,7 @@
* along with Memoserv. If not, see <http://www.gnu.org/licenses/>. * along with Memoserv. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "block_db.hpp" #include "savegame_db.hpp"
#include "memcard/block.hpp" #include "memcard/block.hpp"
#include <algorithm> #include <algorithm>
#include <ciso646> #include <ciso646>
@ -41,11 +41,11 @@ std::string BlockEntry::title() const {
return blocks.front().title(); return blocks.front().title();
} }
BlockDb::BlockDb() = default; SavegameDb::SavegameDb() = default;
BlockDb::~BlockDb() noexcept = default; SavegameDb::~SavegameDb() noexcept = default;
template <bool Const> template <bool Const>
unsigned int BlockDb::add (const std::vector<mc::psx::BasicBlock<Const> >& blocks) { unsigned int SavegameDb::add (const std::vector<mc::psx::BasicBlock<Const> >& blocks) {
constexpr auto block_size = mc::psx::BasicBlock<Const>::BlockByteSize; constexpr auto block_size = mc::psx::BasicBlock<Const>::BlockByteSize;
constexpr auto frame_size = mc::psx::BasicFrame<Const>::Size; constexpr auto frame_size = mc::psx::BasicFrame<Const>::Size;
assert(not blocks.empty()); assert(not blocks.empty());
@ -77,6 +77,6 @@ unsigned int BlockDb::add (const std::vector<mc::psx::BasicBlock<Const> >& block
return static_cast<unsigned int>(m_saves.size() - 1u); return static_cast<unsigned int>(m_saves.size() - 1u);
} }
template unsigned int BlockDb::add<true> (const std::vector<mc::psx::BasicBlock<true> >&); template unsigned int SavegameDb::add<true> (const std::vector<mc::psx::BasicBlock<true> >&);
template unsigned int BlockDb::add<false> (const std::vector<mc::psx::BasicBlock<false> >&); template unsigned int SavegameDb::add<false> (const std::vector<mc::psx::BasicBlock<false> >&);
} //namespace duck } //namespace duck

View file

@ -42,10 +42,10 @@ struct BlockEntry {
std::unique_ptr<uint8_t[]> data; std::unique_ptr<uint8_t[]> data;
}; };
class BlockDb { class SavegameDb {
public: public:
BlockDb(); SavegameDb();
~BlockDb() noexcept; ~SavegameDb() noexcept;
template <bool Const> template <bool Const>
unsigned int add (const std::vector<mc::psx::BasicBlock<Const> >& blocks); unsigned int add (const std::vector<mc::psx::BasicBlock<Const> >& blocks);