MCPcopy Create free account
hub / github.com/Cpasjuste/pplay / Main

Method Main

src/main.cpp:50–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48using namespace pplay;
49
50Main::Main(const c2d::Vector2f &size) : C2DRenderer(size) {
51
52#ifndef NDEBUG
53 Renderer::setPrintStats(true);
54#endif
55
56 // custom io
57 pplayIo = new pplay::Io();
58 Main::setIo(pplayIo);
59
60 // create pplay data directory
61 pplayIo->create(pplayIo->getDataPath() + "mpv");
62
63 // configure input
64 Main::getInput()->setRepeatDelay(INPUT_DELAY);
65
66 // create a timer
67 timer = new C2DClock();
68
69 // init/load config file
70 config = new PPLAYConfig(this);
71
72 // scaling
73 scaling = {size.x / 1280.0f, size.y / 720.0f};
74
75 // font
76 font = new Font();
77 font->loadFromFile(Main::getIo()->getRomFsPath() + "skin/font.ttf");
78 font->setFilter(Texture::Filter::Point);
79 font->setOffset({0, -4.0f});
80
81 statusBox = new StatusBox(this, {0, Main::getSize().y - 16});
82 statusBox->setOrigin(Origin::BottomLeft);
83 statusBox->setLayer(10);
84 Main::add(statusBox);
85
86 // media information cache
87 Main::getIo()->create(Main::getIo()->getDataPath() + "cache");
88
89 // create filer
90 FloatRect filerRect = {0, 0, Main::getSize().x, Main::getSize().y};
91 filer = new Filer(this, "/", filerRect);
92 filer->setLayer(1);
93 Main::add(filer);
94 filer->getDir(config->getOption(OPT_LAST_PATH)->getString());
95
96 // status bar
97 statusBar = new StatusBar(this);
98 statusBar->setLayer(10);
99 Main::add(statusBar);
100
101 // ffmpeg player
102 player = new Player(this);
103 player->setLayer(2);
104 Main::add(player);
105
106 // main menu
107 std::vector<MenuItem> items;

Callers

nothing calls this directly

Calls 7

getDataPathMethod · 0.80
getRomFsPathMethod · 0.80
getDirMethod · 0.80
setVisibilityMethod · 0.45
clearMethod · 0.45
setFillColorMethod · 0.45
setAlphaMethod · 0.45

Tested by

no test coverage detected