mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-01-29 18:28:02 +01:00
0955295475
byuu says: Changelog: - nall/vector rewritten from scratch - higan/audio uses nall/vector instead of raw pointers - higan/sfc/coprocessor/sdd1 updated with new research information - ruby/video/glx and ruby/video/glx2: fuck salt glXSwapIntervalEXT! The big change here is definitely nall/vector. The Windows, OS X and Qt ports won't compile until you change some first/last strings to left/right, but GTK will compile. I'd be really grateful if anyone could stress-test nall/vector. Pretty much everything I do relies on this class. If we introduce a bug, the worst case scenario is my entire SFC game dump database gets corrupted, or the byuu.org server gets compromised. So it's really critical that we test the hell out of this right now. The S-DD1 changes mean you need to update your installation of icarus again. Also, even though the Lunar FMV never really worked on the accuracy core anyway (it didn't initialize the PPU properly), it really won't work now that we emulate the hard-limit of 16MiB for S-DD1 games.
65 lines
1.4 KiB
C++
65 lines
1.4 KiB
C++
#if defined(Hiro_MenuBar)
|
|
|
|
auto mMenuBar::allocate() -> pObject* {
|
|
return new pMenuBar(*this);
|
|
}
|
|
|
|
auto mMenuBar::destruct() -> void {
|
|
for(auto& menu : state.menus) menu->destruct();
|
|
mObject::destruct();
|
|
}
|
|
|
|
//
|
|
|
|
auto mMenuBar::append(sMenu menu) -> type& {
|
|
state.menus.append(menu);
|
|
menu->setParent(this, menuCount() - 1);
|
|
signal(append, menu);
|
|
return *this;
|
|
}
|
|
|
|
auto mMenuBar::menu(unsigned position) const -> Menu {
|
|
if(position < menuCount()) return state.menus[position];
|
|
return {};
|
|
}
|
|
|
|
auto mMenuBar::menuCount() const -> unsigned {
|
|
return state.menus.size();
|
|
}
|
|
|
|
auto mMenuBar::menus() const -> vector<Menu> {
|
|
vector<Menu> menus;
|
|
for(auto& menu : state.menus) menus.append(menu);
|
|
return menus;
|
|
}
|
|
|
|
auto mMenuBar::remove() -> type& {
|
|
if(auto window = parentWindow()) window->remove(window->menuBar());
|
|
return *this;
|
|
}
|
|
|
|
auto mMenuBar::remove(sMenu menu) -> type& {
|
|
signed offset = menu->offset();
|
|
signal(remove, *menu);
|
|
state.menus.remove(offset);
|
|
for(auto n : range(offset, menuCount())) {
|
|
state.menus[n]->adjustOffset(-1);
|
|
}
|
|
menu->setParent();
|
|
return *this;
|
|
}
|
|
|
|
auto mMenuBar::reset() -> type& {
|
|
while(state.menus) remove(state.menus.right());
|
|
return *this;
|
|
}
|
|
|
|
auto mMenuBar::setParent(mObject* parent, signed offset) -> type& {
|
|
for(auto n : rrange(state.menus)) state.menus[n]->destruct();
|
|
mObject::setParent(parent, offset);
|
|
for(auto& menu : state.menus) menu->setParent(this, menu->offset());
|
|
return *this;
|
|
}
|
|
|
|
#endif
|