mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-26 11:44:27 +02:00
Update to v106r48 release.
byuu says: The problems with the Windows and Qt4 ports have all been resolved, although there's a fairly gross hack on a few Qt widgets to not destruct once Application::quit() is called to avoid a double free crash (I'm unsure where Qt is destructing the widgets internally.) The Cocoa port compiles again at least, though it's bound to have endless problems. I improved the Label painting in the GTK ports, which fixes the background color on labels inside TabFrame widgets. I've optimized the Makefile system even further. I added a "redo state" command to bsnes, which is created whenever you load the undo state. There are also hotkeys for both now, although I don't think they're really something you want to map hotkeys to. I moved the nall::Locale object inside hiro::Application, so that it can be used to translate the BrowserDialog and MessageDialog window strings. I improved the Super Game Boy emulation of `MLT_REQ`, fixing Pokemon Yellow's custom border and probably more stuff. Lots of other small fixes and improvements. Things are finally stable once again after the harrowing layout redesign catastrophe. Errata: - ICD::joypID should be set to 3 on reset(). joypWrite() may as well take uint1 instead of bool. - hiro/Qt: remove pWindow::setMaximumSize() comment; found a workaround for it - nall/GNUmakefile: don't set object.path if it's already set (allow overrides before including the file)
This commit is contained in:
@@ -5,7 +5,10 @@ namespace hiro {
|
||||
auto pDesktop::size() -> Size {
|
||||
@autoreleasepool {
|
||||
NSRect primary = [[[NSScreen screens] objectAtIndex:0] frame];
|
||||
return {(int)primary.size.width, (int)primary.size.height};
|
||||
return {
|
||||
(int)primary.size.width,
|
||||
(int)primary.size.height
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +16,12 @@ auto pDesktop::workspace() -> Geometry {
|
||||
@autoreleasepool {
|
||||
auto screen = Desktop::size();
|
||||
NSRect area = [[[NSScreen screens] objectAtIndex:0] visibleFrame];
|
||||
return {(int)area.origin.x, (int)(screen.height() - area.size.height - area.origin.y), (int)area.size.width, (int)area.size.height};
|
||||
return {
|
||||
(int)area.origin.x,
|
||||
(int)area.origin.y,
|
||||
(int)area.size.width,
|
||||
(int)area.size.height
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -20,15 +20,33 @@ auto pMonitor::dpi(uint monitor) -> Position {
|
||||
auto pMonitor::geometry(uint monitor) -> Geometry {
|
||||
@autoreleasepool {
|
||||
NSRect rectangle = [[[NSScreen screens] objectAtIndex:monitor] frame];
|
||||
return {(int)rectangle.origin.x, (int)rectangle.origin.y, (int)rectangle.size.width, (int)rectangle.size.height};
|
||||
return {
|
||||
(int)rectangle.origin.x,
|
||||
(int)rectangle.origin.y,
|
||||
(int)rectangle.size.width,
|
||||
(int)rectangle.size.height
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
auto pMonitor::primary() -> uint {
|
||||
//on OS X, the primary monitor is always the first monitor
|
||||
//on macOS, the primary monitor is always the first monitor
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto pMonitor::workspace(uint monitor) -> Geometry {
|
||||
@autoreleasepool {
|
||||
NSRect size = [[[NSScreen screens] objectAtIndex:monitor] frame];
|
||||
NSRect area = [[[NSScreen screens] objectAtIndex:monitor] visibleFrame];
|
||||
return {
|
||||
(int)area.origin.x,
|
||||
(int)area.origin.y,
|
||||
(int)area.size.width,
|
||||
(int)area.size.height
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -7,6 +7,7 @@ struct pMonitor {
|
||||
static auto dpi(uint monitor) -> Position;
|
||||
static auto geometry(uint monitor) -> Geometry;
|
||||
static auto primary() -> uint;
|
||||
static auto workspace(uint monitor) -> Geometry;
|
||||
};
|
||||
|
||||
}
|
||||
|
@@ -1,11 +1,3 @@
|
||||
namespace hiro {
|
||||
struct pFont;
|
||||
struct pWindow;
|
||||
struct pMenu;
|
||||
struct pLayout;
|
||||
struct pWidget;
|
||||
}
|
||||
|
||||
#define Declare(Name, Base) \
|
||||
p##Name(m##Name& reference) : p##Base(reference) {} \
|
||||
auto self() const -> m##Name& { return (m##Name&)reference; } \
|
||||
|
@@ -39,14 +39,14 @@ auto pFrame::remove(sSizable sizable) -> void {
|
||||
|
||||
auto pFrame::setEnabled(bool enabled) -> void {
|
||||
pWidget::setEnabled(enabled);
|
||||
if(auto& sizable = _sizable()) sizable->setEnabled(sizable->self().enabled(true));
|
||||
if(auto sizable = _sizable()) sizable->setEnabled(sizable->self().enabled(true));
|
||||
}
|
||||
|
||||
auto pFrame::setFont(const Font& font) -> void {
|
||||
@autoreleasepool {
|
||||
[cocoaView setTitleFont:pFont::create(font)];
|
||||
}
|
||||
if(auto& sizable = _sizable()) sizable->setFont(sizable->self().font(true));
|
||||
if(auto sizable = _sizable()) sizable->setFont(sizable->self().font(true));
|
||||
}
|
||||
|
||||
auto pFrame::setGeometry(Geometry geometry) -> void {
|
||||
@@ -56,7 +56,7 @@ auto pFrame::setGeometry(Geometry geometry) -> void {
|
||||
geometry.x() - 3, geometry.y() - (empty ? size.height() - 2 : 1),
|
||||
geometry.width() + 6, geometry.height() + (empty ? size.height() + 2 : 5)
|
||||
});
|
||||
if(auto& sizable = state().sizable) {
|
||||
if(auto sizable = _sizable()) {
|
||||
sizable->setGeometry({
|
||||
geometry.x() + 1, geometry.y() + (empty ? 1 : size.height() - 2),
|
||||
geometry.width() - 2, geometry.height() - (empty ? 1 : size.height() - 1)
|
||||
@@ -72,14 +72,14 @@ auto pFrame::setText(const string& text) -> void {
|
||||
|
||||
auto pFrame::setVisible(bool visible) -> void {
|
||||
pWidget::setVisible(visible);
|
||||
if(auto& sizable = _sizable()) sizable->setVisible(sizable->self().visible(true));
|
||||
if(auto sizable = _sizable()) sizable->setVisible(sizable->self().visible(true));
|
||||
}
|
||||
|
||||
auto pFrame::_sizable() -> maybe<pSizable&> {
|
||||
if(auto sizable = state().sizable) {
|
||||
if(auto self = sizable->self()) return *self;
|
||||
}
|
||||
return nothing;
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@
|
||||
}
|
||||
|
||||
-(void) tabView:(NSTabView*)tabView didSelectTabViewItem:(NSTabViewItem*)tabViewItem {
|
||||
tabFrame->self()->_synchronizeLayout();
|
||||
tabFrame->self()->_synchronizeSizable();
|
||||
tabFrame->doChange();
|
||||
}
|
||||
|
||||
@@ -104,8 +104,8 @@ auto pTabFrame::remove(sTabFrameItem item) -> void {
|
||||
auto pTabFrame::setEnabled(bool enabled) -> void {
|
||||
pWidget::setEnabled(enabled);
|
||||
for(auto& item : state().items) {
|
||||
if(auto& layout = item->state.layout) {
|
||||
if(auto self = layout->self()) self->setEnabled(layout->enabled(true));
|
||||
if(auto& sizable = item->state.sizable) {
|
||||
if(auto self = sizable->self()) self->setEnabled(sizable->enabled(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,8 +113,8 @@ auto pTabFrame::setEnabled(bool enabled) -> void {
|
||||
auto pTabFrame::setFont(const Font& font) -> void {
|
||||
pWidget::setFont(font);
|
||||
for(auto& item : state().items) {
|
||||
if(auto& layout = item->state.layout) {
|
||||
if(auto self = layout->self()) self->setFont(layout->font(true));
|
||||
if(auto& sizable = item->state.sizable) {
|
||||
if(auto self = sizable->self()) self->setFont(sizable->font(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,11 +129,11 @@ auto pTabFrame::setGeometry(Geometry geometry) -> void {
|
||||
geometry.width() - 2, geometry.height() - 32
|
||||
});
|
||||
for(auto& item : state().items) {
|
||||
if(auto& layout = item->state.layout) {
|
||||
layout->setGeometry(geometry);
|
||||
if(auto& sizable = item->state.sizable) {
|
||||
sizable->setGeometry(geometry);
|
||||
}
|
||||
}
|
||||
_synchronizeLayout();
|
||||
_synchronizeSizable();
|
||||
}
|
||||
|
||||
auto pTabFrame::setNavigation(Navigation navigation) -> void {
|
||||
@@ -142,20 +142,20 @@ auto pTabFrame::setNavigation(Navigation navigation) -> void {
|
||||
auto pTabFrame::setVisible(bool visible) -> void {
|
||||
pWidget::setVisible(visible);
|
||||
for(auto& item : state().items) {
|
||||
if(auto& layout = item->state.layout) {
|
||||
if(auto self = layout->self()) self->setVisible(layout->visible(true));
|
||||
if(auto& sizable = item->state.sizable) {
|
||||
if(auto self = sizable->self()) self->setVisible(sizable->visible(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto pTabFrame::_synchronizeLayout() -> void {
|
||||
auto pTabFrame::_synchronizeSizable() -> void {
|
||||
@autoreleasepool {
|
||||
NSTabViewItem* tabViewItem = [cocoaView selectedTabViewItem];
|
||||
int selected = tabViewItem ? [cocoaView indexOfTabViewItem:tabViewItem] : -1;
|
||||
for(auto& item : state().items) {
|
||||
item->state.selected = item->offset() == selected;
|
||||
if(auto& layout = item->state.layout) {
|
||||
if(auto self = layout->self()) self->setVisible(layout->visible(true) && item->selected());
|
||||
if(auto& sizable = item->state.sizable) {
|
||||
if(auto self = sizable->self()) self->setVisible(sizable->visible(true) && item->selected());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ struct pTabFrame : pWidget {
|
||||
auto setNavigation(Navigation navigation) -> void;
|
||||
auto setVisible(bool visible) -> void override;
|
||||
|
||||
auto _synchronizeLayout() -> void;
|
||||
auto _synchronizeSizable() -> void;
|
||||
|
||||
CocoaTabFrame* cocoaTabFrame = nullptr;
|
||||
vector<CocoaTabFrameItem*> tabs;
|
||||
|
@@ -406,7 +406,7 @@ auto pTableView::_width(uint column) -> uint {
|
||||
uint width = 1;
|
||||
if(!header->column(column).visible()) return width;
|
||||
if(header->visible()) width = max(width, _columnWidth(column));
|
||||
for(auto row : range(state().items)) {
|
||||
for(auto row : range(state().items.size())) {
|
||||
width = max(width, _cellWidth(row, column));
|
||||
}
|
||||
return width;
|
||||
|
@@ -217,7 +217,7 @@ auto pWindow::append(sMenuBar menuBar) -> void {
|
||||
}
|
||||
|
||||
auto pWindow::append(sSizable sizable) -> void {
|
||||
layout->setGeometry(self().geometry().setPosition(0, 0));
|
||||
sizable->setGeometry(self().geometry().setPosition());
|
||||
statusBarReposition();
|
||||
}
|
||||
|
||||
@@ -320,8 +320,8 @@ auto pWindow::setGeometry(Geometry geometry) -> void {
|
||||
display:YES
|
||||
];
|
||||
|
||||
if(auto& layout = state().layout) {
|
||||
layout->setGeometry(self().geometry().setPosition(0, 0));
|
||||
if(auto& sizable = state().sizable) {
|
||||
sizable->setGeometry(self().geometry().setPosition());
|
||||
}
|
||||
|
||||
statusBarReposition();
|
||||
@@ -402,8 +402,8 @@ auto pWindow::sizeEvent() -> void {
|
||||
}
|
||||
}
|
||||
|
||||
if(auto& layout = state().layout) {
|
||||
layout->setGeometry(self().geometry().setPosition(0, 0));
|
||||
if(auto& sizable = state().sizable) {
|
||||
sizable->setGeometry(self().geometry().setPosition());
|
||||
}
|
||||
|
||||
statusBarReposition();
|
||||
|
Reference in New Issue
Block a user