54 lines
1.6 KiB
C++
54 lines
1.6 KiB
C++
#include "memcard/memorycard.hpp"
|
|
#include "widget/block_grid.hpp"
|
|
#include "make_nana_animation.hpp"
|
|
#include <nana/gui.hpp>
|
|
#include <nana/gui/widgets/label.hpp>
|
|
#include <iostream>
|
|
#include <fstream>
|
|
|
|
#include <vector>
|
|
#include <iostream>
|
|
|
|
namespace {
|
|
const constexpr int g_def_icon_size = 48;
|
|
const constexpr int g_def_icon_fps = 3;
|
|
} //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));
|
|
const MemoryCard mc2(std::ifstream("/home/michele/dev/code/cpp/memoserv/michele_epsxe000.mcr", std::ios::binary));
|
|
|
|
#if !defined(NDEBUG)
|
|
//grid1.bgcolor(nana::colors::azure);
|
|
#endif
|
|
|
|
duck::widget::BlockGrid grid1{frm, 3, true};
|
|
duck::widget::BlockGrid grid2{frm, 3, true};
|
|
|
|
for (int z = 0; z < 15; ++z) {
|
|
if (mc1[z].has_magic())
|
|
grid1.emplace_back(duck::make_nana_animation(mc1[z], g_def_icon_size, g_def_icon_size, g_def_icon_fps));
|
|
if (mc2[z].has_magic())
|
|
grid2.emplace_back(duck::make_nana_animation(mc2[z], g_def_icon_size, g_def_icon_size, g_def_icon_fps));
|
|
}
|
|
|
|
nana::label label1 {frm, "Slot 1"};
|
|
nana::label label2 {frm, "Slot 2"};
|
|
|
|
std::cout << "Hello world\n";
|
|
frm.div("fit margin=3 <vert fit slot1> <width=25> <vert fit slot2>");
|
|
frm["slot1"] << label1 << grid1;
|
|
frm["slot2"] << label2 << grid2;
|
|
frm.collocate();
|
|
frm.show();
|
|
|
|
//const MemoryCard mc(std::ifstream("/home/michele/emu/psx/WipEout 3 - Special Edition (Europe) (En,Fr,De,Es,It).srm", std::ios::binary));
|
|
//MemoryCard mc(std::ifstream("/home/michele/emu/psx/Rapid Racer (Europe) (En,Fr,De,Es,It).srm", std::ios::binary));
|
|
|
|
|
|
nana::exec();
|
|
return 0;
|
|
}
|