mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-30 20:40:06 +02:00
Update to v094r41 release (open beta).
byuu says: Changelog (since the last open beta): - icarus is now included. icarus is used to import game files/archives into game paks (folders) - SNES: mid-scanline BGMODE changes now emulated correctly (used only by atx2.smc Anthrox Demo) - GBA: fixed a CPU bug that was causing dozens of games to have distorted audio - GBA: fixed default FlashROM ID; should allow much higher compatibility - GBA: now using Cydrak's new, much improved, GBA color emulation filter (still a work-in-progress) - re-added command-line loading support for game paks (not for game files/archives, sorry!) - Qt port now compiles and runs again (may be a little buggy; Windows/GTK+ ports preferred) - SNES performance profile now compiles and runs again - much more
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
#include "widget/combo-button-item.cpp"
|
||||
#include "widget/frame.cpp"
|
||||
#include "widget/hex-edit.cpp"
|
||||
#include "widget/horizontal-scroller.cpp"
|
||||
#include "widget/horizontal-scroll-bar.cpp"
|
||||
#include "widget/horizontal-slider.cpp"
|
||||
#include "widget/label.cpp"
|
||||
#include "widget/line-edit.cpp"
|
||||
@@ -53,7 +53,7 @@
|
||||
#include "widget/tab-frame.cpp"
|
||||
#include "widget/tab-frame-item.cpp"
|
||||
#include "widget/text-edit.cpp"
|
||||
#include "widget/vertical-scroller.cpp"
|
||||
#include "widget/vertical-scroll-bar.cpp"
|
||||
#include "widget/vertical-slider.cpp"
|
||||
#include "widget/viewport.cpp"
|
||||
|
||||
|
@@ -67,7 +67,7 @@ static vector<wObject> windows;
|
||||
#include "widget/combo-button-item.hpp"
|
||||
#include "widget/frame.hpp"
|
||||
#include "widget/hex-edit.hpp"
|
||||
#include "widget/horizontal-scroller.hpp"
|
||||
#include "widget/horizontal-scroll-bar.hpp"
|
||||
#include "widget/horizontal-slider.hpp"
|
||||
#include "widget/label.hpp"
|
||||
#include "widget/line-edit.hpp"
|
||||
@@ -82,7 +82,7 @@ static vector<wObject> windows;
|
||||
#include "widget/tab-frame.hpp"
|
||||
#include "widget/tab-frame-item.hpp"
|
||||
#include "widget/text-edit.hpp"
|
||||
#include "widget/vertical-scroller.hpp"
|
||||
#include "widget/vertical-scroll-bar.hpp"
|
||||
#include "widget/vertical-slider.hpp"
|
||||
#include "widget/viewport.hpp"
|
||||
|
||||
|
@@ -103,7 +103,7 @@ static auto ScrollEvent(HWND hwnd, WPARAM wparam) -> unsigned {
|
||||
info.fMask = SIF_POS;
|
||||
SetScrollInfo(hwnd, SB_CTL, &info, TRUE);
|
||||
|
||||
//Windows may clamp position to scroller range
|
||||
//Windows may clamp position to scrollbar range
|
||||
GetScrollInfo(hwnd, SB_CTL, &info);
|
||||
return info.nPos;
|
||||
}
|
||||
@@ -351,9 +351,9 @@ static auto CALLBACK Shared_windowProc(WindowProc windowProc, HWND hwnd, UINT ms
|
||||
auto object = (mObject*)GetWindowLongPtr((HWND)lparam, GWLP_USERDATA);
|
||||
if(!object) break;
|
||||
|
||||
#if defined(Hiro_HorizontalScroller)
|
||||
if(auto horizontalScroller = dynamic_cast<mHorizontalScroller*>(object)) {
|
||||
return horizontalScroller->self()->onChange(wparam), true;
|
||||
#if defined(Hiro_HorizontalScrollBar)
|
||||
if(auto horizontalScrollBar = dynamic_cast<mHorizontalScrollBar*>(object)) {
|
||||
return horizontalScrollBar->self()->onChange(wparam), true;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -363,9 +363,9 @@ static auto CALLBACK Shared_windowProc(WindowProc windowProc, HWND hwnd, UINT ms
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(Hiro_VerticalScroller)
|
||||
if(auto verticalScroller = dynamic_cast<mVerticalScroller*>(object)) {
|
||||
return verticalScroller->self()->onChange(wparam), true;
|
||||
#if defined(Hiro_VerticalScrollBar)
|
||||
if(auto verticalScrollBar = dynamic_cast<mVerticalScrollBar*>(object)) {
|
||||
return verticalScrollBar->self()->onChange(wparam), true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -19,7 +19,7 @@ auto pCheckButton::destruct() -> void {
|
||||
DestroyWindow(hwnd);
|
||||
}
|
||||
|
||||
auto pCheckButton::minimumSize() -> Size {
|
||||
auto pCheckButton::minimumSize() const -> Size {
|
||||
auto size = pFont::size(hfont, state().text);
|
||||
|
||||
if(state().orientation == Orientation::Horizontal) {
|
||||
|
@@ -5,7 +5,7 @@ namespace hiro {
|
||||
struct pCheckButton : pWidget {
|
||||
Declare(CheckButton, Widget)
|
||||
|
||||
auto minimumSize() -> Size;
|
||||
auto minimumSize() const -> Size override;
|
||||
auto setBordered(bool bordered) -> void;
|
||||
auto setChecked(bool checked) -> void;
|
||||
auto setIcon(const image& icon) -> void;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
#if defined(Hiro_HorizontalScroller)
|
||||
#if defined(Hiro_HorizontalScrollBar)
|
||||
|
||||
namespace hiro {
|
||||
|
||||
auto pHorizontalScroller::construct() -> void {
|
||||
auto pHorizontalScrollBar::construct() -> void {
|
||||
hwnd = CreateWindow(
|
||||
L"SCROLLBAR", L"", WS_CHILD | WS_TABSTOP | SBS_HORZ,
|
||||
0, 0, 0, 0, _parentHandle(), nullptr, GetModuleHandle(0), 0
|
||||
@@ -13,24 +13,24 @@ auto pHorizontalScroller::construct() -> void {
|
||||
setPosition(state().position);
|
||||
}
|
||||
|
||||
auto pHorizontalScroller::destruct() -> void {
|
||||
auto pHorizontalScrollBar::destruct() -> void {
|
||||
DestroyWindow(hwnd);
|
||||
}
|
||||
|
||||
auto pHorizontalScroller::minimumSize() const -> Size {
|
||||
auto pHorizontalScrollBar::minimumSize() const -> Size {
|
||||
return {0, 18};
|
||||
}
|
||||
|
||||
auto pHorizontalScroller::setLength(unsigned length) -> void {
|
||||
auto pHorizontalScrollBar::setLength(unsigned length) -> void {
|
||||
length += (length == 0);
|
||||
SetScrollRange(hwnd, SB_CTL, 0, length - 1, TRUE);
|
||||
}
|
||||
|
||||
auto pHorizontalScroller::setPosition(unsigned position) -> void {
|
||||
auto pHorizontalScrollBar::setPosition(unsigned position) -> void {
|
||||
SetScrollPos(hwnd, SB_CTL, position, TRUE);
|
||||
}
|
||||
|
||||
auto pHorizontalScroller::onChange(WPARAM wparam) -> void {
|
||||
auto pHorizontalScrollBar::onChange(WPARAM wparam) -> void {
|
||||
unsigned position = ScrollEvent(hwnd, wparam);
|
||||
if(position == state().position) return;
|
||||
state().position = position;
|
@@ -1,9 +1,9 @@
|
||||
#if defined(Hiro_HorizontalScroller)
|
||||
#if defined(Hiro_HorizontalScrollBar)
|
||||
|
||||
namespace hiro {
|
||||
|
||||
struct pHorizontalScroller : pWidget {
|
||||
Declare(HorizontalScroller, Widget)
|
||||
struct pHorizontalScrollBar : pWidget {
|
||||
Declare(HorizontalScrollBar, Widget)
|
||||
|
||||
auto minimumSize() const -> Size override;
|
||||
auto setLength(unsigned length) -> void;
|
@@ -57,15 +57,6 @@ auto pListView::remove(sListViewHeader header) -> void {
|
||||
auto pListView::remove(sListViewItem item) -> void {
|
||||
}
|
||||
|
||||
auto pListView::reset() -> void {
|
||||
lock();
|
||||
ListView_DeleteAllItems(hwnd);
|
||||
LVCOLUMN lvColumn{LVCF_WIDTH};
|
||||
while(ListView_GetColumn(hwnd, 0, &lvColumn)) ListView_DeleteColumn(hwnd, 0);
|
||||
_setIcons(); //free icon resources
|
||||
unlock();
|
||||
}
|
||||
|
||||
auto pListView::resizeColumns() -> void {
|
||||
lock();
|
||||
|
||||
@@ -200,7 +191,12 @@ auto pListView::onCustomDraw(LPARAM lparam) -> LRESULT {
|
||||
bool selected = state().items(row)->state.selected;
|
||||
|
||||
if(auto cell = self().item(row)->cell(column)) {
|
||||
HBRUSH brush = CreateSolidBrush(selected ? GetSysColor(COLOR_HIGHLIGHT) : CreateRGB(cell->backgroundColor(true)));
|
||||
auto backgroundColor = cell->backgroundColor(true);
|
||||
HBRUSH brush = CreateSolidBrush(
|
||||
selected ? GetSysColor(COLOR_HIGHLIGHT)
|
||||
: backgroundColor ? CreateRGB(backgroundColor)
|
||||
: GetSysColor(COLOR_WINDOW)
|
||||
);
|
||||
FillRect(hdc, &rc, brush);
|
||||
DeleteObject(brush);
|
||||
|
||||
@@ -235,7 +231,12 @@ auto pListView::onCustomDraw(LPARAM lparam) -> LRESULT {
|
||||
if(!alignment) alignment = {0.0, 0.5};
|
||||
utf16_t wText(text);
|
||||
SetBkMode(hdc, TRANSPARENT);
|
||||
SetTextColor(hdc, selected ? GetSysColor(COLOR_HIGHLIGHTTEXT) : CreateRGB(cell->foregroundColor(true)));
|
||||
auto foregroundColor = cell->foregroundColor(true);
|
||||
SetTextColor(hdc,
|
||||
selected ? GetSysColor(COLOR_HIGHLIGHTTEXT)
|
||||
: foregroundColor ? CreateRGB(foregroundColor)
|
||||
: GetSysColor(COLOR_WINDOWTEXT)
|
||||
);
|
||||
auto style = DT_SINGLELINE | DT_NOPREFIX | DT_END_ELLIPSIS;
|
||||
style |= alignment.horizontal() < 0.333 ? DT_LEFT : alignment.horizontal() > 0.666 ? DT_RIGHT : DT_CENTER;
|
||||
style |= alignment.vertical() < 0.333 ? DT_TOP : alignment.vertical() > 0.666 ? DT_BOTTOM : DT_VCENTER;
|
||||
@@ -246,9 +247,12 @@ auto pListView::onCustomDraw(LPARAM lparam) -> LRESULT {
|
||||
DeleteObject(font);
|
||||
}
|
||||
} else {
|
||||
auto color = state().backgroundColor;
|
||||
if(!color) color = {255, 255, 255};
|
||||
HBRUSH brush = CreateSolidBrush(selected ? GetSysColor(COLOR_HIGHLIGHT) : CreateRGB(color));
|
||||
auto backgroundColor = state().backgroundColor;
|
||||
HBRUSH brush = CreateSolidBrush(
|
||||
selected ? GetSysColor(COLOR_HIGHLIGHT)
|
||||
: backgroundColor ? CreateRGB(backgroundColor)
|
||||
: GetSysColor(COLOR_WINDOW)
|
||||
);
|
||||
FillRect(hdc, &rc, brush);
|
||||
DeleteObject(brush);
|
||||
}
|
||||
|
@@ -9,7 +9,6 @@ struct pListView : pWidget {
|
||||
auto append(sListViewItem item) -> void;
|
||||
auto remove(sListViewHeader header) -> void;
|
||||
auto remove(sListViewItem item) -> void;
|
||||
auto reset() -> void;
|
||||
auto resizeColumns() -> void;
|
||||
auto setAlignment(Alignment alignment) -> void;
|
||||
auto setBackgroundColor(Color color) -> void;
|
||||
|
@@ -19,7 +19,7 @@ auto pRadioButton::destruct() -> void {
|
||||
DestroyWindow(hwnd);
|
||||
}
|
||||
|
||||
auto pRadioButton::minimumSize() -> Size {
|
||||
auto pRadioButton::minimumSize() const -> Size {
|
||||
auto size = pFont::size(hfont, state().text);
|
||||
|
||||
if(state().orientation == Orientation::Horizontal) {
|
||||
|
@@ -5,7 +5,7 @@ namespace hiro {
|
||||
struct pRadioButton : pWidget {
|
||||
Declare(RadioButton, Widget)
|
||||
|
||||
auto minimumSize() -> Size;
|
||||
auto minimumSize() const -> Size override;
|
||||
auto setBordered(bool bordered) -> void;
|
||||
auto setChecked() -> void;
|
||||
auto setGroup(sGroup group) -> void override;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
#if defined(Hiro_VerticalScroller)
|
||||
#if defined(Hiro_VerticalScrollBar)
|
||||
|
||||
namespace hiro {
|
||||
|
||||
auto pVerticalScroller::construct() -> void {
|
||||
auto pVerticalScrollBar::construct() -> void {
|
||||
hwnd = CreateWindow(
|
||||
L"SCROLLBAR", L"", WS_CHILD | SBS_VERT,
|
||||
0, 0, 0, 0, _parentHandle(), nullptr, GetModuleHandle(0), 0
|
||||
@@ -13,24 +13,24 @@ auto pVerticalScroller::construct() -> void {
|
||||
setPosition(state().position);
|
||||
}
|
||||
|
||||
auto pVerticalScroller::destruct() -> void {
|
||||
auto pVerticalScrollBar::destruct() -> void {
|
||||
DestroyWindow(hwnd);
|
||||
}
|
||||
|
||||
auto pVerticalScroller::minimumSize() const -> Size {
|
||||
auto pVerticalScrollBar::minimumSize() const -> Size {
|
||||
return {18, 0};
|
||||
}
|
||||
|
||||
auto pVerticalScroller::setLength(unsigned length) -> void {
|
||||
auto pVerticalScrollBar::setLength(unsigned length) -> void {
|
||||
length += (length == 0);
|
||||
SetScrollRange(hwnd, SB_CTL, 0, length - 1, TRUE);
|
||||
}
|
||||
|
||||
auto pVerticalScroller::setPosition(unsigned position) -> void {
|
||||
auto pVerticalScrollBar::setPosition(unsigned position) -> void {
|
||||
SetScrollPos(hwnd, SB_CTL, position, TRUE);
|
||||
}
|
||||
|
||||
auto pVerticalScroller::onChange(WPARAM wparam) -> void {
|
||||
auto pVerticalScrollBar::onChange(WPARAM wparam) -> void {
|
||||
unsigned position = ScrollEvent(hwnd, wparam);
|
||||
if(position == state().position) return;
|
||||
state().position = position;
|
@@ -1,9 +1,9 @@
|
||||
#if defined(Hiro_VerticalScroller)
|
||||
#if defined(Hiro_VerticalScrollBar)
|
||||
|
||||
namespace hiro {
|
||||
|
||||
struct pVerticalScroller : pWidget {
|
||||
Declare(VerticalScroller, Widget)
|
||||
struct pVerticalScrollBar : pWidget {
|
||||
Declare(VerticalScrollBar, Widget)
|
||||
|
||||
auto minimumSize() const -> Size override;
|
||||
auto setLength(unsigned length) -> void;
|
@@ -18,7 +18,7 @@ auto pVerticalSlider::destruct() -> void {
|
||||
}
|
||||
|
||||
auto pVerticalSlider::minimumSize() const -> Size {
|
||||
return {0, 25};
|
||||
return {25, 0};
|
||||
}
|
||||
|
||||
auto pVerticalSlider::setLength(unsigned length) -> void {
|
||||
|
Reference in New Issue
Block a user