diff --git a/src/gui/main.cpp b/src/gui/main.cpp index a9d856c..824d0fb 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -15,6 +15,7 @@ namespace { } //unnamed namespace int main() { + using mc::MemoryCard; nana::form frm; const MemoryCard mc1(std::ifstream("/home/michele/dev/code/cpp/memoserv/epsxe000_xa2.mcr", std::ios::binary)); diff --git a/src/gui/make_nana_animation.cpp b/src/gui/make_nana_animation.cpp index bc58666..1627fa2 100644 --- a/src/gui/make_nana_animation.cpp +++ b/src/gui/make_nana_animation.cpp @@ -3,8 +3,9 @@ #include "memcard/icon_fetch.hpp" namespace duck { - AnimationWithSize make_nana_animation (const ConstBlock& block, int width, int height, int fps) { + AnimationWithSize make_nana_animation (const mc::ConstBlock& block, int width, int height, int fps) { nana::frameset fset; + using mc::icon_fetch; for (const auto& frame : icon_fetch(block, width, height)) { nana::paint::image img; diff --git a/src/gui/make_nana_animation.hpp b/src/gui/make_nana_animation.hpp index 0a077be..0311b8e 100644 --- a/src/gui/make_nana_animation.hpp +++ b/src/gui/make_nana_animation.hpp @@ -2,9 +2,11 @@ #include "animation_with_size.hpp" +namespace mc { template class BasicBlock; using ConstBlock = BasicBlock; +} //namespace mc namespace duck { - AnimationWithSize make_nana_animation (const ConstBlock& block, int width, int height, int fps); + AnimationWithSize make_nana_animation (const mc::ConstBlock& block, int width, int height, int fps); } //namespace duck diff --git a/subprojects/memcard/include/memcard/block.hpp b/subprojects/memcard/include/memcard/block.hpp index 41977fa..a1b5346 100644 --- a/subprojects/memcard/include/memcard/block.hpp +++ b/subprojects/memcard/include/memcard/block.hpp @@ -6,6 +6,7 @@ //see: https://www.psdevwiki.com/ps3/PS1_Savedata#Memory_Card_Formats_PS1 +namespace mc { enum class IconDisplayFlag { NoIcon = 0x00, OneFrame = 0x11, @@ -63,3 +64,4 @@ inline int32_t calc_icon_count (IconDisplayFlag idf) { using Block = BasicBlock; using ConstBlock = BasicBlock; +} //namespace mc diff --git a/subprojects/memcard/include/memcard/icon_fetch.hpp b/subprojects/memcard/include/memcard/icon_fetch.hpp index f5ca745..2ebbfdd 100644 --- a/subprojects/memcard/include/memcard/icon_fetch.hpp +++ b/subprojects/memcard/include/memcard/icon_fetch.hpp @@ -3,4 +3,6 @@ #include "memcard/block.hpp" #include +namespace mc { std::vector> icon_fetch (const ConstBlock& block, int width, int height); +} //namespace mc diff --git a/subprojects/memcard/include/memcard/memorycard.hpp b/subprojects/memcard/include/memcard/memorycard.hpp index 25eb0cc..75651a3 100644 --- a/subprojects/memcard/include/memcard/memorycard.hpp +++ b/subprojects/memcard/include/memcard/memorycard.hpp @@ -1,12 +1,13 @@ #pragma once -#include "block.hpp" +#include "memcard/block.hpp" #include #include #include #include #include +namespace mc { class MemoryCard { public: MemoryCard(); @@ -19,3 +20,4 @@ public: private: std::vector m_data; }; +} //namespace mc diff --git a/subprojects/memcard/src/block.cpp b/subprojects/memcard/src/block.cpp index b932291..ee3847f 100644 --- a/subprojects/memcard/src/block.cpp +++ b/subprojects/memcard/src/block.cpp @@ -6,6 +6,7 @@ #define FLOAT_PALETTE_CONV +namespace mc { namespace { #if defined(FLOAT_PALETTE_CONV) uint8_t _5bit_to_8bit(int n) { @@ -89,3 +90,4 @@ IconDisplayFlag BasicBlock::icon_display_flag() const { template class BasicBlock; template class BasicBlock; +} //namespace mc diff --git a/subprojects/memcard/src/icon_fetch.cpp b/subprojects/memcard/src/icon_fetch.cpp index 822be0f..84725fc 100644 --- a/subprojects/memcard/src/icon_fetch.cpp +++ b/subprojects/memcard/src/icon_fetch.cpp @@ -6,6 +6,7 @@ #include #include +namespace mc { namespace { namespace bmp { const uint16_t g_signature = 'B' bitor (static_cast('M') << 8); @@ -194,3 +195,4 @@ std::vector> icon_fetch (const ConstBlock& block, int width, i } return retval; } +} //namespace mc diff --git a/subprojects/memcard/src/memorycard.cpp b/subprojects/memcard/src/memorycard.cpp index 172cb90..2a54600 100644 --- a/subprojects/memcard/src/memorycard.cpp +++ b/subprojects/memcard/src/memorycard.cpp @@ -4,6 +4,7 @@ #include #include +namespace mc { MemoryCard::MemoryCard() : m_data(8192 * 16) { @@ -33,3 +34,4 @@ ConstBlock MemoryCard::operator[] (std::size_t index) const { assert(index < 15); return ConstBlock(m_data.data() + (index + 1) * Block::size()); } +} //namespace mc diff --git a/subprojects/memcard/src/resize_harris.cpp b/subprojects/memcard/src/resize_harris.cpp index a9f24d5..75b23f0 100644 --- a/subprojects/memcard/src/resize_harris.cpp +++ b/subprojects/memcard/src/resize_harris.cpp @@ -36,6 +36,7 @@ #include #include +namespace mc { namespace { template [[gnu::pure]] @@ -308,3 +309,4 @@ std::vector blackmanharris_resize ( return retval; } +} //namespace mc diff --git a/subprojects/memcard/src/resize_harris.hpp b/subprojects/memcard/src/resize_harris.hpp index d178eb5..f6936a2 100644 --- a/subprojects/memcard/src/resize_harris.hpp +++ b/subprojects/memcard/src/resize_harris.hpp @@ -2,6 +2,7 @@ #include +namespace mc { std::vector blackmanharris_resize ( int in_w, int in_h, @@ -9,3 +10,4 @@ std::vector blackmanharris_resize ( int out_w, int out_h ); +} //namespace mc