mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-09-02 18:02:49 +02:00
Update to v094r43 release.
byuu says: Updated to compile with all of the new hiro changes. My next step is to write up hiro API documentation, and move the API from alpha (constantly changing) to beta (rarely changing), in preparation for the first stable release (backward-compatible changes only.) Added "--fullscreen" command-line option. I like this over a configuration file option. Lets you use the emulator in both modes without having to modify the config file each time. Also enhanced the command-line game loading. You can now use any of these methods: higan /path/to/game-folder.sfc higan /path/to/game-folder.sfc/ higan /path/to/game-folder.sfc/program.rom The idea is to support launchers that insist on loading files only. Technically, the file can be any name (manifest.bml also works); the only criteria is that the file actually exists and is a file, and not a directory. This is a requirement to support the first version (a directory lacking the trailing / identifier), because I don't want my nall::string class to query the file system to determine if the string is an actual existing file or directory for its pathname() / dirname() functions. Anyway, every game folder I've made so far has program.rom, and that's very unlikely to change, so this should be fine. Now, of course, if you drop a regular "game.sfc" file on the emulator, it won't even try to load it, unless it's in a folder that ends in .fc, .sfc, etc. In which case, it'll bail out immediately by being unable to produce a manifest for what is obviously not really a game folder.
This commit is contained in:
@@ -12,7 +12,7 @@ auto pAction::setEnabled(bool enabled) -> void {
|
||||
_setState();
|
||||
}
|
||||
|
||||
auto pAction::setFont(const string& font) -> void {
|
||||
auto pAction::setFont(const Font& font) -> void {
|
||||
_setState();
|
||||
}
|
||||
|
||||
|
@@ -6,7 +6,7 @@ struct pAction : pObject {
|
||||
Declare(Action, Object)
|
||||
|
||||
auto setEnabled(bool enabled) -> void override;
|
||||
auto setFont(const string& font) -> void override;
|
||||
auto setFont(const Font& font) -> void override;
|
||||
auto setVisible(bool visible) -> void override;
|
||||
|
||||
auto _parentMenu() -> maybe<pMenu&>;
|
||||
|
@@ -22,7 +22,7 @@ auto pMenuItem::destruct() -> void {
|
||||
qtMenuItem = nullptr;
|
||||
}
|
||||
|
||||
auto pMenuItem::setIcon(const image& icon) -> void {
|
||||
auto pMenuItem::setImage(const Image& icon) -> void {
|
||||
_setState();
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ auto pMenuItem::setText(const string& text) -> void {
|
||||
}
|
||||
|
||||
auto pMenuItem::_setState() -> void {
|
||||
qtMenuItem->setIcon(CreateIcon(state().icon));
|
||||
qtMenuItem->setIcon(CreateImage(state().image));
|
||||
qtMenuItem->setText(state().text);
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@ namespace hiro {
|
||||
struct pMenuItem : pAction {
|
||||
Declare(MenuItem, Action)
|
||||
|
||||
auto setIcon(const image& icon) -> void;
|
||||
auto setImage(const Image& image) -> void;
|
||||
auto setText(const string& text) -> void;
|
||||
|
||||
auto _setState() -> void override;
|
||||
|
@@ -18,6 +18,7 @@ auto pMenuRadioItem::construct() -> void {
|
||||
parent->qtPopupMenu->addAction(qtMenuRadioItem);
|
||||
}
|
||||
|
||||
setGroup(state().group);
|
||||
_setState();
|
||||
}
|
||||
|
||||
@@ -33,7 +34,19 @@ auto pMenuRadioItem::setChecked() -> void {
|
||||
}
|
||||
|
||||
auto pMenuRadioItem::setGroup(sGroup group) -> void {
|
||||
_setState();
|
||||
bool first = true;
|
||||
if(auto& group = state().group) {
|
||||
for(auto& weak : group->state.objects) {
|
||||
if(auto object = weak.acquire()) {
|
||||
if(auto menuRadioItem = dynamic_cast<mMenuRadioItem*>(object.data())) {
|
||||
if(auto self = menuRadioItem->self()) {
|
||||
self->qtMenuRadioItem->setChecked(menuRadioItem->state.checked = first);
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto pMenuRadioItem::setText(const string& text) -> void {
|
||||
@@ -41,7 +54,7 @@ auto pMenuRadioItem::setText(const string& text) -> void {
|
||||
}
|
||||
|
||||
auto pMenuRadioItem::_setState() -> void {
|
||||
if(auto group = state().group) {
|
||||
if(auto& group = state().group) {
|
||||
if(auto object = group->object(0)) {
|
||||
if(auto menuRadioItem = dynamic_cast<mMenuRadioItem*>(object.data())) {
|
||||
if(auto self = menuRadioItem->self()) {
|
||||
@@ -56,7 +69,7 @@ auto pMenuRadioItem::_setState() -> void {
|
||||
|
||||
auto QtMenuRadioItem::onActivate() -> void {
|
||||
if(p.state().checked) return;
|
||||
p.state().checked = true;
|
||||
p.self().setChecked();
|
||||
p.self().doActivate();
|
||||
}
|
||||
|
||||
|
@@ -33,7 +33,7 @@ auto pMenu::append(sAction action) -> void {
|
||||
auto pMenu::remove(sAction action) -> void {
|
||||
}
|
||||
|
||||
auto pMenu::setIcon(const image& icon) -> void {
|
||||
auto pMenu::setImage(const Image& image) -> void {
|
||||
_setState();
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ auto pMenu::setText(const string& text) -> void {
|
||||
auto pMenu::_setState() -> void {
|
||||
qtMenu->setEnabled(self().enabled());
|
||||
qtMenu->setFont(pFont::create(self().font(true)));
|
||||
qtMenu->setIcon(CreateIcon(state().icon));
|
||||
qtMenu->setIcon(CreateImage(state().image));
|
||||
qtMenu->setTitle(QString::fromUtf8(state().text));
|
||||
qtMenu->menuAction()->setVisible(self().visible());
|
||||
|
||||
|
@@ -7,7 +7,7 @@ struct pMenu : public pAction {
|
||||
|
||||
auto append(sAction action) -> void;
|
||||
auto remove(sAction action) -> void;
|
||||
auto setIcon(const image& icon) -> void;
|
||||
auto setImage(const Image& image) -> void;
|
||||
auto setText(const string& text) -> void;
|
||||
|
||||
auto _setState() -> void override;
|
||||
|
Reference in New Issue
Block a user